src/virtual-machines/source-1-with-mark-region-gc.js
// if hole large enough isn't found, bump head and tail will be last hole.
if hole large enough isn't found, bump head and tail will be last hole.
if hole large enough isn ' t found bump head and tail will be last hole .
function ALLOCATE_TO_RECYCLABLE() {
  for (I = 0; I < NUMBER_OF_BLOCKS; I = I + 1) {
    if ( 
      HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] === RECYCLABLE
    ) {
      SCAN = I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT];
      while (SCAN <= I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + LAST_CHILD_SLOT]) {
        if (HEAP[SCAN + LINE_LIMIT_SLOT] === HEAP[SCAN + LINE_ADDRESS_SLOT]) {
          BUMP_HEAD = SCAN === I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT] 
            ? HEAP[SCAN + LINE_ADDRESS_SLOT]
            : HEAP[SCAN - LINE_BK_SIZE + LINE_LIMIT_SLOT];
          ALLOCATE_BUMP_TAIL();
          if (BUMP_HEAD + K <= BUMP_TAIL) {
            return undefined;
          } else {
            A = BUMP_TAIL - 1;
            GET_LINE();
            SCAN = RES + LINE_BK_SIZE; 
          }
        } else {
          SCAN = SCAN + LINE_BK_SIZE;
        }
      }
    } else {}
  }
}
function ALLOCATE_TO_RECYCLABLE ( ) { for ( I = 0 ; I < NUMBER_OF_BLOCKS ; I = I + 1 ) { if ( HEAP [ I * BLOCK_SIZE + BLOCK_STATE_SLOT ] === RECYCLABLE ) { SCAN = I * BLOCK_SIZE + HEAP [ I * BLOCK_SIZE + FIRST_CHILD_SLOT ] ; while ( SCAN <= I * BLOCK_SIZE + HEAP [ I * BLOCK_SIZE + LAST_CHILD_SLOT ] ) { if ( HEAP [ SCAN + LINE_LIMIT_SLOT ] === HEAP [ SCAN + LINE_ADDRESS_SLOT ] ) { BUMP_HEAD = SCAN === I * BLOCK_SIZE + HEAP [ I * BLOCK_SIZE + FIRST_CHILD_SLOT ] ? HEAP [ SCAN + LINE_ADDRESS_SLOT ] : HEAP [ SCAN - LINE_BK_SIZE + LINE_LIMIT_SLOT ] ; ALLOCATE_BUMP_TAIL ( ) ; if ( BUMP_HEAD + K <= BUMP_TAIL ) { return undefined ; } else { A = BUMP_TAIL - 1 ; GET_LINE ( ) ; SCAN = RES + LINE_BK_SIZE ; } } else { SCAN = SCAN + LINE_BK_SIZE ; } } } else { } } }
if hole large enough isn't found, bump head and tail will be last hole.
if hole large enough isn ' t found bump head and tail will be last hole .
// if block is free or recyclable, // find k-sized hole // if line is free/empty // set bump head to end of previous line // if first line // get previous line but increment manually