mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Always initialize nursery data structures even if size is smaller than one chunk.
This commit is contained in:
parent
9a1685a422
commit
54cfba5b8f
1 changed files with 7 additions and 7 deletions
|
|
@ -121,6 +121,13 @@ js::Nursery::Nursery(JSRuntime* rt)
|
|||
bool
|
||||
js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGC& lock)
|
||||
{
|
||||
if (!mallocedBuffers.init())
|
||||
return false;
|
||||
|
||||
freeMallocedBuffersTask = js_new<FreeMallocedBuffersTask>(runtime()->defaultFreeOp());
|
||||
if (!freeMallocedBuffersTask || !freeMallocedBuffersTask->init())
|
||||
return false;
|
||||
|
||||
/* maxNurseryBytes parameter is rounded down to a multiple of chunk size. */
|
||||
maxNurseryChunks_ = maxNurseryBytes >> ChunkShift;
|
||||
|
||||
|
|
@ -128,16 +135,9 @@ js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGC& lock)
|
|||
if (maxNurseryChunks_ == 0)
|
||||
return true;
|
||||
|
||||
if (!mallocedBuffers.init())
|
||||
return false;
|
||||
|
||||
if (!cellsWithUid_.init())
|
||||
return false;
|
||||
|
||||
freeMallocedBuffersTask = js_new<FreeMallocedBuffersTask>(runtime()->defaultFreeOp());
|
||||
if (!freeMallocedBuffersTask || !freeMallocedBuffersTask->init())
|
||||
return false;
|
||||
|
||||
AutoMaybeStartBackgroundAllocation maybeBgAlloc;
|
||||
updateNumChunksLocked(1, maybeBgAlloc, lock);
|
||||
if (numChunks() == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue