Closed Bug 526793 Opened 15 years ago Closed 14 years ago

Add gczeal() function to xpcshell

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dwitte, Assigned: jdm)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

This would be useful for unit tests, to detect GC hazards. For instance, one could do "gczeal(2);", and expect exercised code to crash if code has obvious liveness/rooting flaws. jsshell has this feature; though this bug may belong in Testing/TUnit rather than xpcshell proper. (do_setgczeal?)

I would certainly use this in unit tests for jsctypes, for instance, which uses JSAPI heavily and has many opportunities for gc hazards.
Nope, it's xpcshell proper, probably about ten lines.
Attached patch Patch (obsolete) — Splinter Review
This did not take very long at all, but it's my first time touching js stuff.  Please be gentle?
Assignee: nobody → josh
Attachment #433207 - Flags: review?(mrbkap)
Comment on attachment 433207 [details] [diff] [review]
Patch

r=me if you use JS_ValueToECMAUint32, as the regular JS shell does.
Attachment #433207 - Flags: review?(mrbkap) → review+
Attached patch Patch + comment addressed (obsolete) — Splinter Review
Now using ValueToECMABlahblah.
Attachment #433207 - Attachment is obsolete: true
Attached patch PatchSplinter Review
Now with IRC comments about early return addressed.
Attachment #433209 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/fb40471645ea
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: