3 struct bump_allocator {
4 /* offset of 'here' and 'end' is hardcoded in compiler backends */
10 bump_allocator(cell size, cell start)
11 : here(start), start(start), end(start + size), size(size) {}
13 bool contains_p(object* obj) { return ((cell)obj - start) < size; }
15 object* allot(cell size) {
17 here = h + align(size, data_alignment);
21 cell occupied_space() { return here - start; }
23 cell free_space() { return end - here; }
28 /* In case of bugs, there may be bogus references pointing to the
29 memory space after the gc has run. Filling it with a pattern
30 makes accesses to such shadow data fail hard. */
31 memset_cell((void*)start, 0xbaadbaad, size);