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) {
14 return (cell)obj >= start && (cell)obj < end;
17 object* allot(cell size) {
19 here = h + align(size, data_alignment);
23 cell occupied_space() { return here - start; }
25 cell free_space() { return end - here; }
30 // In case of bugs, there may be bogus references pointing to the
31 // memory space after the gc has run. Filling it with a pattern
32 // makes accesses to such shadow data fail hard.
33 memset_cell((void*)start, 0xbaadbaad, size);