bug 601075 - followup to fix MSVC warings and adjust the testStringBufferMallocAccounting.js test to overwrite all conservative GC roots.

This commit is contained in:
Igor Bukanov 2011-06-19 19:41:46 +02:00
parent 3a56f020bc
commit 0e73de0a0a
2 changed files with 11 additions and 6 deletions

View File

@ -4,10 +4,15 @@ for (var i = 0; i < 20; ++i)
str = str + str;
str.indexOf('a');
// copying this sucker should gc
makeFinalizeObserver();
var f;
f = makeFinalizeObserver();
assertEq(finalizeCount(), 0);
// Create another observer to make sure that we overwrite all conservative
// roots for the previous one and can observer the GC.
f = makeFinalizeObserver();
// if the assert fails, add more iterations
for (var i = 0; i < 50; ++i)
for (var i = 0; i < 80; ++i)
str.replace(/(a)/, '$1');
assertEq(finalizeCount(), 1);

View File

@ -261,7 +261,7 @@ struct ArenaHeader {
}
void setAsFullyUsed() {
firstFreeSpanStart = firstFreeSpanEnd = ArenaSize;
firstFreeSpanStart = firstFreeSpanEnd = uint16_t(ArenaSize);
}
FreeSpan getFirstFreeSpan() const {
@ -543,8 +543,8 @@ ArenaHeader::init(JSCompartment *comp, unsigned kind, size_t thingSize)
JS_ASSERT(!getMarkingDelay()->link);
compartment = comp;
thingKind = kind;
firstFreeSpanStart = Arena::thingsStartOffset(thingSize);
firstFreeSpanEnd = ArenaSize;
firstFreeSpanStart = uint16_t(Arena::thingsStartOffset(thingSize));
firstFreeSpanEnd = uint16_t(ArenaSize);
}
inline uintptr_t