Bug 558861 - Fix assertion on startup. r=gal
authorGregor Wagner <anygregor@gmail.com>
Fri, 24 Sep 2010 15:07:02 -0700
changeset 54711 543d3ddf76e02e9b9f3f817771bb6957b940186d
parent 54710 31904ce8b08b7d33292a2047438fb3ead597866e
child 54712 b7869eca1558417f2b77ae5f43deb5fb08008832
push id16011
push userrsayre@mozilla.com
push dateWed, 29 Sep 2010 06:01:57 +0000
treeherdermozilla-central@d7e659b4f80c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs558861
milestone2.0b7pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 558861 - Fix assertion on startup. r=gal
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -371,19 +371,21 @@ Chunk::init(JSRuntime *rt)
     info.runtime = rt;
     info.age = 0;
     info.emptyArenaLists.init();
     info.emptyArenaLists.cellFreeList = &arenas[0];
     Arena<FreeCell> *arena = &arenas[0];
     Arena<FreeCell> *last = &arenas[JS_ARRAY_LENGTH(arenas) - 1];
     while (arena < last) {
         arena->header()->next = arena + 1;
+        arena->header()->isUsed = false;
         ++arena;
     }
     last->header()->next = NULL;
+    last->header()->isUsed = false;
     info.numFree = ArenasPerChunk;
 }
 
 bool
 Chunk::unused()
 {
     return info.numFree == ArenasPerChunk;
 }
@@ -523,17 +525,17 @@ PickChunk(JSContext *cx)
             return r.front();
     }
 
     chunk = AllocateGCChunk(rt);
     if (!chunk)
         return NULL;
 
     /*
-     * FIXME bug 583732 - chunk is newly allocated and cannot present in
+     * FIXME bug 583732 - chunk is newly allocated and cannot be present in
      * the table so using ordinary lookupForAdd is suboptimal here.
      */
     GCChunkSet::AddPtr p = rt->gcChunkSet.lookupForAdd(chunk);
     JS_ASSERT(!p);
     if (!rt->gcChunkSet.add(p, chunk)) {
         ReleaseGCChunk(rt, chunk);
         return NULL;
     }