mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 17:17:31 +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
|
bool
|
||||||
js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGC& lock)
|
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. */
|
/* maxNurseryBytes parameter is rounded down to a multiple of chunk size. */
|
||||||
maxNurseryChunks_ = maxNurseryBytes >> ChunkShift;
|
maxNurseryChunks_ = maxNurseryBytes >> ChunkShift;
|
||||||
|
|
||||||
|
|
@ -128,16 +135,9 @@ js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGC& lock)
|
||||||
if (maxNurseryChunks_ == 0)
|
if (maxNurseryChunks_ == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!mallocedBuffers.init())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!cellsWithUid_.init())
|
if (!cellsWithUid_.init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
freeMallocedBuffersTask = js_new<FreeMallocedBuffersTask>(runtime()->defaultFreeOp());
|
|
||||||
if (!freeMallocedBuffersTask || !freeMallocedBuffersTask->init())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
AutoMaybeStartBackgroundAllocation maybeBgAlloc;
|
AutoMaybeStartBackgroundAllocation maybeBgAlloc;
|
||||||
updateNumChunksLocked(1, maybeBgAlloc, lock);
|
updateNumChunksLocked(1, maybeBgAlloc, lock);
|
||||||
if (numChunks() == 0)
|
if (numChunks() == 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue