Reset nursery position when it's disabled.
This commit is contained in:
parent
01b53534c3
commit
66d7b35f08
|
@ -210,6 +210,7 @@ js::Nursery::disable()
|
|||
return;
|
||||
updateNumChunks(0);
|
||||
currentEnd_ = 0;
|
||||
position_ = 0;
|
||||
runtime()->gc.storeBuffer.disable();
|
||||
}
|
||||
|
||||
|
|
|
@ -245,6 +245,7 @@ class Nursery
|
|||
|
||||
// Free space remaining, not counting chunk trailers.
|
||||
MOZ_ALWAYS_INLINE size_t freeSpace() const {
|
||||
MOZ_ASSERT(isEnabled());
|
||||
MOZ_ASSERT(currentEnd_ - position_ <= NurseryChunkUsableSize);
|
||||
return (currentEnd_ - position_) +
|
||||
(numChunks() - currentChunk_ - 1) * NurseryChunkUsableSize;
|
||||
|
|
Loading…
Reference in New Issue
Block a user