]> gitweb.factorcode.org Git - factor.git/blob - vm/aging_space.hpp
VM: Refactor aging_space to Factor style
[factor.git] / vm / aging_space.hpp
1 namespace factor {
2
3 struct aging_space : bump_allocator<object> {
4   object_start_map starts;
5
6   explicit aging_space(cell size, cell start)
7       : bump_allocator<object>(size, start), starts(size, start) {}
8
9   object* allot(cell size) {
10     if (here + size > end)
11       return NULL;
12
13     object* obj = bump_allocator<object>::allot(size);
14     starts.record_object_start_offset(obj);
15     return obj;
16   }
17 };
18
19 }