Closed Bug 941262 Opened 11 years ago Closed 11 years ago

AutoAssertNoGC with no runtime

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: sfink, Assigned: sfink)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

We'd like to be able to use AutoAssertNoGC in places that may not even have a runtime.
It bothered me a little bit that you could put this in main() and it would "succeed". So at least, I make sure you don't create a runtime and do some GCing within its scope. ;-)
Attachment #8335564 - Flags: review?(terrence)
Blocks: 940765
Comment on attachment 8335564 [details] [diff] [review]
AutoAssertNoGC with no runtime

Review of attachment 8335564 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

::: js/src/jsgc.cpp
@@ +5384,5 @@
>  {
> +    if (runtime)
> +        MOZ_ASSERT(gcNumber == runtime->gcNumber, "GC ran inside an AutoAssertNoGC scope.");
> +    else
> +        MOZ_ASSERT(!js::TlsPerThreadData.get(), "Runtime created within AutoAssertNoGC scope?");

Good idea!
Attachment #8335564 - Flags: review?(terrence) → review+
https://hg.mozilla.org/mozilla-central/rev/326cf83b0416
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: