no overlaps
| 22 | assert((y - x)*(z - y) > 0, "allocations must be in the same direction"); |
| 23 | // no overlaps |
| 24 | function notInRange(value, begin, end) { |
| 25 | function errormsg() { return value + " must not be in the range (" + begin + ", " + end + "]"; } |
| 26 | if (begin < end) assert(!(value >= begin && value < end), errormsg()); |
| 27 | else assert(!(value <= begin && value > end), errormsg()); |
| 28 | } |
| 29 | notInRange(x, y, y + direction*size); |
| 30 | notInRange(x, z, z + direction*size); |
| 31 | notInRange(y, x, x + direction*size); |