summaryrefslogtreecommitdiffstats
path: root/js/src/gc/Nursery.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-06-25 19:07:10 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-05 20:37:26 +0100
commita9b44dbcb33cd98b163f8a21223643f2cf3829cd (patch)
treef22acdd5995354fa704855a57cc09d54392d902e /js/src/gc/Nursery.cpp
parent1ca042464ff2bf651dc25073764733197e5f4cc7 (diff)
downloadUXP-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.tar
UXP-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.tar.gz
UXP-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.tar.lz
UXP-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.tar.xz
UXP-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.zip
Always initialize nursery data structures even if size is smaller than one chunk.
Diffstat (limited to 'js/src/gc/Nursery.cpp')
-rw-r--r--js/src/gc/Nursery.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index bce2b74aa..aa50bf29e 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -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)