mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 899367 - Add an API to determine if we're marking gray. r=billm
This allows us to assert that certain callbacks get invoked during the gray phase of a marking GC.
This commit is contained in:
parent
7367a3a5b8
commit
b239d46a8b
@ -2379,6 +2379,15 @@ JS_IsGCMarkingTracer(JSTracer *trc)
|
||||
return IS_GC_MARKING_TRACER(trc);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_IsMarkingGray(JSTracer *trc)
|
||||
{
|
||||
JS_ASSERT(JS_IsGCMarkingTracer(trc));
|
||||
return trc->callback == GCMarker::GrayCallback;
|
||||
}
|
||||
#endif
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_GC(JSRuntime *rt)
|
||||
{
|
||||
|
@ -2210,6 +2210,12 @@ JS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_IsGCMarkingTracer(JSTracer *trc);
|
||||
|
||||
/* For assertions only. */
|
||||
#ifdef DEBUG
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_IsMarkingGray(JSTracer *trc);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* JS_IsAboutToBeFinalized checks if the given object is going to be finalized
|
||||
* at the end of the current GC. When called outside of the context of a GC,
|
||||
|
Loading…
Reference in New Issue
Block a user