From 5d0b67951bafa92e59a9e9ceeaffbb8ad94cf847 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 15 Aug 2008 11:31:26 +0000 Subject: [PATCH] 1.0.19.29: new function: page_region_start() ...and use where appropriate. --- src/runtime/gencgc.c | 18 ++++++++++-------- version.lisp-expr | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 699cc62..1be0721 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -176,6 +176,13 @@ page_address(page_index_t page_num) return (heap_base + (page_num * PAGE_BYTES)); } +/* Calculate the address where the allocation region associated with the page starts. */ +inline void * +page_region_start(page_index_t page_index) +{ + return page_address(page_index)+page_table[page_index].first_object_offset; +} + /* Find the page index within the page_table for the given * address. Return -1 on failure. */ inline page_index_t @@ -2115,8 +2122,7 @@ search_dynamic_space(void *pointer) if ((page_index == -1) || (page_table[page_index].allocated == FREE_PAGE_FLAG)) return NULL; - start = (lispobj *)((void *)page_address(page_index) - + page_table[page_index].first_object_offset); + start = (lispobj *)page_region_start(page_index); return (gc_search_space(start, (((lispobj *)pointer)+2)-start, (lispobj *)pointer)); @@ -2647,9 +2653,7 @@ preserve_pointer(void *addr) #if 0 /* I think this'd work just as well, but without the assertions. * -dan 2004.01.01 */ - first_page= - find_page_index(page_address(addr_page_index)+ - page_table[addr_page_index].first_object_offset); + first_page = find_page_index(page_region_start(addr_page_index)) #else first_page = addr_page_index; while (page_table[first_page].first_object_offset != 0) { @@ -2986,9 +2990,7 @@ scavenge_newspace_generation_one_scan(generation_index_t generation) - page_table[i].first_object_offset)/N_WORD_BYTES; new_areas_ignore_page = last_page; - scavenge(page_address(i) + - page_table[i].first_object_offset, - size); + scavenge(page_region_start(i), size); } i = last_page; diff --git a/version.lisp-expr b/version.lisp-expr index 54397f3..eb782f2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.19.28" +"1.0.19.29" -- 1.7.10.4