LargeInteger* Process::NewIntegerWithGC(int64 value) {
Object* result = NewInteger(value);
if (result->IsRetryAfterGCFailure()) {
program()->CollectGarbage();
result = NewInteger(value);
if (result->IsRetryAfterGCFailure()) {
program()->CollectGarbage();
result = NewInteger(value);
}
}
return LargeInteger::cast(result);
}
It seems fragile to rely on the behaviour of trying GC'ing twice.
Better it would be to ask the gc to free at least x bytes, and let it do as many collections as necessary.
In
src/vm/process.cc
we haveIt seems fragile to rely on the behaviour of trying GC'ing twice. Better it would be to ask the gc to free at least
x
bytes, and let it do as many collections as necessary.@DmitryOlshansky-google