Bug 747066 - Add vtable assertion (r=bz)

--HG--
extra : rebase_source : e989536ee950152925c353c26ead9a56adea2baa
This commit is contained in:
Bill McCloskey 2012-12-06 17:11:45 -08:00
parent fd0b4af925
commit 09086dd412

View File

@ -85,6 +85,10 @@ JSCompartment::JSCompartment(JSRuntime *rt)
, ionCompartment_(NULL)
#endif
{
/* Ensure that there are no vtables to mess us up here. */
JS_ASSERT(reinterpret_cast<JS::shadow::Compartment *>(this) ==
static_cast<JS::shadow::Compartment *>(this));
setGCMaxMallocBytes(rt->gcMaxMallocBytes * 0.9);
}