diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2017-06-25 19:07:10 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-05 20:37:26 +0100 |
commit | fe4e32e393834b67055c93064f5c6c287de493cc (patch) | |
tree | f22acdd5995354fa704855a57cc09d54392d902e /js | |
parent | a6582b53ee18fd20a6155732276ecf0e9745df46 (diff) | |
download | uxp-fe4e32e393834b67055c93064f5c6c287de493cc.tar.gz |
Always initialize nursery data structures even if size is smaller than one chunk.
Diffstat (limited to 'js')
-rw-r--r-- | js/src/gc/Nursery.cpp | 14 |
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) |