VM: a little faster definition of contains_p()
parent
8aadd38071
commit
3eef76c686
|
@ -10,7 +10,9 @@ struct bump_allocator {
|
||||||
bump_allocator(cell size, cell start)
|
bump_allocator(cell size, cell start)
|
||||||
: here(start), start(start), end(start + size), size(size) {}
|
: here(start), start(start), end(start + size), size(size) {}
|
||||||
|
|
||||||
bool contains_p(object* obj) { return ((cell)obj - start) < size; }
|
bool contains_p(object* obj) {
|
||||||
|
return (cell)obj >= start && (cell)obj < end;
|
||||||
|
}
|
||||||
|
|
||||||
object* allot(cell size) {
|
object* allot(cell size) {
|
||||||
cell h = here;
|
cell h = here;
|
||||||
|
|
Loading…
Reference in New Issue