AutoAssertNoGC with no runtime

RESOLVED FIXED in mozilla28

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

unspecified
mozilla28
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

We'd like to be able to use AutoAssertNoGC in places that may not even have a runtime.
Created attachment 8335564 [details] [diff] [review]
AutoAssertNoGC with no 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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28

Updated

4 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.