summaryrefslogtreecommitdiff
path: root/js/src/gc
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
parent1ca042464ff2bf651dc25073764733197e5f4cc7 (diff)
downloaduxp-a9b44dbcb33cd98b163f8a21223643f2cf3829cd.tar.gz
Always initialize nursery data structures even if size is smaller than one chunk.
Diffstat (limited to 'js/src/gc')
-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 bce2b74aa5..aa50bf29e5 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)