src/virtual-machines/source-1-with-mark-region-gc.js
// Returns the address of the first free block scanning from the first block
Returns the address of the first free block scanning from the first block
Returns the address of the first free block scanning from the first block
function GET_FREE_BLOCK() {
  RES = NO_BLOCK_FOUND;
  for (let i = 0; i < NUMBER_OF_BLOCKS; i = i + 1) {
    if (HEAP[i * BLOCK_SIZE + BLOCK_STATE_SLOT] === FREE) {
      RES = BLOCK_SIZE * i;
      break;
    } else {}
  }
}
function GET_FREE_BLOCK ( ) { RES = NO_BLOCK_FOUND ; for ( let i = 0 ; i < NUMBER_OF_BLOCKS ; i = i + 1 ) { if ( HEAP [ i * BLOCK_SIZE + BLOCK_STATE_SLOT ] === FREE ) { RES = BLOCK_SIZE * i ; break ; } else { } } }
Returns the address of the first free block scanning from the first block
Returns the address of the first free block scanning from the first block
// if no block is recyclable