/** * External allocation slow path (called by superclass when slow path is actually taken. This is * necessary (rather than a direct call from the fast path) because of the possibility of a thread * switch and corresponding re-association of bump pointers to kernel threads. * * @param bytes The number of bytes allocated * @param align The requested alignment * @param offset The offset from the alignment * @return The address of the first byte of the allocated region or zero on failure */ protected final Address allocSlowOnce(int bytes, int align, int offset) { Address ptr = space.getSpace(hot, copy, lineUseCount); if (ptr.isZero()) { lineUseCount = 0; return ptr; // failed allocation --- we will need to GC } /* we have been given a clean block */ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(Block.isAligned(ptr)); lineUseCount = LINES_IN_BLOCK; zeroBlock(ptr); if (requestForLarge) { largeCursor = ptr; largeLimit = ptr.plus(BYTES_IN_BLOCK); } else { cursor = ptr; limit = ptr.plus(BYTES_IN_BLOCK); } return alloc(bytes, align, offset); }