Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Functionality for allocating 'x' bytes with repeated GC. #569

Open
sigurdm opened this issue Jul 4, 2016 · 0 comments
Open

Functionality for allocating 'x' bytes with repeated GC. #569

sigurdm opened this issue Jul 4, 2016 · 0 comments

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Jul 4, 2016

In src/vm/process.cc we have

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.

@DmitryOlshansky-google

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants