Bug 889986 - Assert nursery allocations are large enough to be replaced with a RelocationOverlay r=terrence

This commit is contained in:
Jon Coppeard 2013-10-07 13:40:47 +01:00
parent 3fb85260a1
commit 8b1e964f27

View File

@ -97,6 +97,9 @@ js::Nursery::allocate(size_t size)
{
JS_ASSERT(!runtime()->isHeapBusy());
/* Ensure there's enough space to replace the contents with a RelocationOverlay. */
JS_ASSERT(size >= sizeof(RelocationOverlay));
if (position() + size > currentEnd()) {
if (currentChunk_ + 1 == numActiveChunks_)
return nullptr;