mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-06 00:31:27 +00:00
Bug 1188124 - Use rootKind to select the right PersistentRooted list head; r=sfink
--HG-- extra : rebase_source : 8f2df6b63bddaac62e2b9def8564432625efaaaf
This commit is contained in:
parent
a161a3e370
commit
a4087728b5
@ -993,7 +993,15 @@ class PersistentRooted : public js::PersistentRootedBase<T>,
|
||||
|
||||
void registerWithRootLists(js::RootLists& roots) {
|
||||
MOZ_ASSERT(!initialized());
|
||||
roots.getPersistentRootedList<T>().insertBack(this);
|
||||
js::ThingRootKind kind = js::RootKind<T>::rootKind();
|
||||
roots.heapRoots_[kind].insertBack(reinterpret_cast<JS::PersistentRooted<void*>*>(this));
|
||||
// Until marking and destruction support the full set, we assert that
|
||||
// we don't try to add any unsupported types.
|
||||
MOZ_ASSERT(kind == js::THING_ROOT_OBJECT ||
|
||||
kind == js::THING_ROOT_SCRIPT ||
|
||||
kind == js::THING_ROOT_STRING ||
|
||||
kind == js::THING_ROOT_ID ||
|
||||
kind == js::THING_ROOT_VALUE);
|
||||
}
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user