Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleSpace.java (simplified)
linenumberstrue
languagejava
public final Address acquire(int pages) {
  pr.reservePages(pages);
  /*/ Poll, either fixing budget or requiring GC
*/   if (VM.activePlan.global().poll(false, this)) {
    VM.collection.blockForGC();
    return Address.zero(); // GC required, return failure
  }
  /*/ Page budget is ok, try to acquire virtual memory
*/   Address rtn = pr.getNewPages(pagesReserved, pages, zeroed);
  if (rtn.isZero()) {  // Failed, so force a GC
    boolean gcPerformed = VM.activePlan.global().poll(true, this);
    VM.collection.blockForGC();
    return Address.zero();
  }
  return rtn;
}

...