1. Between out[0] = 21 and out[0] = 50, allocated size of Array A is 20. However, checkOverlap on out[0] = 32 and out[0] = 42 tests Array A as if allocated size is 3.
let out[0] = 20;
let a = Memory.alloc(20);
let out[3] = a; // RAM[17003] = block address
// ... more test code ...
let out[0] = 32;
do Main.checkOverlap(b, 3, a, 3);
let out[0] = 33;
// ... more test code ...
let out[0] = 42;
do Main.checkOverlap(c, 500, a, 3);
let out[0] = 43;
2. Some out[0] code is used more than once. (code 70, 71, 72)
Primary prupose of out[0] is to distinguish where the test is failed. Therefore I assumed that duplicated code is not intended.
// Deallocate blocks 'b' and 'c'.
let out[0] = 70;
do Memory.deAlloc(c);
let out[0] = 71;
do Memory.deAlloc(b);
let out[0] = 72;
// Test that deallocated blocks are placed on the free list and can
// be reused.
let out[0] = 70;
let a = Memory.alloc(8000);
let out[7] = a; // RAM[17007] = block address
let out[0] = 71;
do Main.checkRange(a, 8000);
let out[0] = 72;
do Memory.deAlloc(a);