build_list_for_new_block(blocks[the_size.current_block], the_size);
int idx = the_size.current_block; if (idx < 0 || idx >= blocks.length) { VM.sysWriteln("idx out of range ",idx); VM.sysWriteln("; len is ",blocks.length); VM.sysWriteln("Processor ", VM_Processor.getCurrentProcessor().id); VM.sysFail("killing VM"); } build_list_for_new_block(blocks[idx], the_size);
  protected VM_Address allocateSlotFromBlocks (VM_SizeControl the_size, int size) {    VM_BlockControl the_block = blocks[the_size.current_block];    // First, look for a slot in the blocks on the existing list    while (the_block.nextblock != OUT_OF_BLOCKS) {      the_size.current_block = the_block.nextblock;      the_block = blocks[the_block.nextblock];      if (build_list(the_block, the_size))	return allocateSlotFast(the_size, the_size.next_slot);    }        // Next, try to get a partially filled block of the given size from the global pool    while (getPartialBlock(the_size.ndx) == 0) {      if (GSC_TRACE) {	VM_Processor.getCurrentProcessor().disableThreadSwitching();	VM.sysWrite("allocatex: adding partial block: ndx "); VM.sysWrite(the_size.ndx,false);	VM.sysWrite(" current was "); VM.sysWrite(the_size.current_block,false);	VM.sysWrite(" new current is "); VM.sysWrite(the_block.nextblock,false);	VM.sysWrite("\n");	VM_Processor.getCurrentProcessor().enableThreadSwitching();      }      the_size.current_block = the_block.nextblock;      the_block = blocks[the_block.nextblock];      if (build_list(the_block, the_size))	return allocateSlotFast(the_size, the_size.next_slot);      if (GSC_TRACE) {	VM_Processor.getCurrentProcessor().disableThreadSwitching();	VM.sysWrite("allocatey: partial block was full\n");	VM_Processor.getCurrentProcessor().enableThreadSwitching();      }    }    // Finally, try to allocate a free block and format it to the given size    if (getnewblock(the_size.ndx) == 0) {      the_size.current_block = the_block.nextblock;      build_list_for_new_block(blocks[the_size.current_block], the_size);      return allocateSlotFast(the_size, the_size.next_slot);    }      // All attempts failed; heap is currently exhausted.    return VM_Address.zero();  }