VM: a little faster definition of contains_p()

locals-and-roots
Björn Lindqvist 2016-06-07 21:44:56 +02:00
parent 8aadd38071
commit 3eef76c686
1 changed files with 3 additions and 1 deletions

View File

@ -10,7 +10,9 @@ struct bump_allocator {
bump_allocator(cell size, cell start)
: 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) {
cell h = here;