From 231f50039b944b38673b6502822948f85892699c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Fri, 21 Nov 2014 09:14:55 +0100 Subject: [PATCH] VM: move next_object_after() and first_object() to aging_space (no iteration possible in nursery) --- vm/aging_space.hpp | 15 +++++++++++++++ vm/bump_allocator.hpp | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/vm/aging_space.hpp b/vm/aging_space.hpp index 54ae44f34f..1c17f71db1 100644 --- a/vm/aging_space.hpp +++ b/vm/aging_space.hpp @@ -14,6 +14,21 @@ struct aging_space : bump_allocator { starts.record_object_start_offset(obj); return obj; } + + cell next_object_after(cell scan) { + cell size = ((object*)scan)->size(); + if (scan + size < here) + return scan + size; + else + return 0; + } + + cell first_object() { + if (start != here) + return start; + else + return 0; + } }; } diff --git a/vm/bump_allocator.hpp b/vm/bump_allocator.hpp index 5e8f3544df..cd4717032d 100644 --- a/vm/bump_allocator.hpp +++ b/vm/bump_allocator.hpp @@ -22,21 +22,6 @@ template struct bump_allocator { cell free_space() { return end - here; } - cell next_object_after(cell scan) { - cell size = ((Block*)scan)->size(); - if (scan + size < here) - return scan + size; - else - return 0; - } - - cell first_object() { - if (start != here) - return start; - else - return 0; - } - void flush() { here = start; #ifdef FACTOR_DEBUG