From 7d4563d4da135a4c31484225b62fa6c20bf13364 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Sun, 19 Mar 2017 11:32:09 -0400 Subject: [PATCH] OAOO-ify WEAK_POINTER_NWORDS --- src/runtime/cheneygc.c | 3 --- src/runtime/gc-common.c | 3 --- src/runtime/gc-internal.h | 3 +++ src/runtime/gencgc.c | 3 --- src/runtime/purify.c | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/runtime/cheneygc.c b/src/runtime/cheneygc.c index 57bba7cd5..a956e21bb 100644 --- a/src/runtime/cheneygc.c +++ b/src/runtime/cheneygc.c @@ -339,9 +339,6 @@ print_garbage(lispobj *from_space, lispobj *from_space_free_pointer) /* weak pointers */ -#define WEAK_POINTER_NWORDS \ - CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2) - static sword_t scav_weak_pointer(lispobj *where, lispobj object) { diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c index edea10646..f66a25363 100644 --- a/src/runtime/gc-common.c +++ b/src/runtime/gc-common.c @@ -903,9 +903,6 @@ DEF_SPECIALIZED_VECTOR(vector_long_float, length * LONG_FLOAT_SIZE) DEF_SPECIALIZED_VECTOR(vector_complex_long_float, length * (2 * LONG_FLOAT_SIZE)) #endif -#define WEAK_POINTER_NWORDS \ - CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2) - static lispobj trans_weak_pointer(lispobj object) { diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index f74a8a8e4..4b5db6f97 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -121,6 +121,9 @@ code_n_funs(struct code* code) { return fixnum_value((code)->n_entries) & 0x3FFF #define SIMPLE_FUN_SCAV_START(fun_ptr) &fun_ptr->name #define SIMPLE_FUN_SCAV_NWORDS(fun_ptr) ((lispobj*)fun_ptr->code - &fun_ptr->name) +#define WEAK_POINTER_NWORDS \ + CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2) + /* values for the *_alloc_* parameters, also see the commentary for * struct page in gencgc-internal.h. FIXME: Perhaps these constants * should be there, or at least defined on gencgc only? */ diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 20ac5c891..f7d0cd4f5 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -1925,9 +1925,6 @@ trans_boxed_large(lispobj object) * maintained within the objects which causes writes to the pages. A * limited attempt is made to avoid unnecessary writes, but this needs * a re-think. */ -#define WEAK_POINTER_NWORDS \ - CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2) - static sword_t scav_weak_pointer(lispobj *where, lispobj object) { diff --git a/src/runtime/purify.c b/src/runtime/purify.c index f1c690975..1efbec8e8 100644 --- a/src/runtime/purify.c +++ b/src/runtime/purify.c @@ -556,7 +556,7 @@ pscav(lispobj *addr, long nwords, boolean constant) /* Weak pointers get preserved during purify, 'cause I * don't feel like figuring out how to break them. */ pscav(addr+1, 2, constant); - count = 4; + count = WEAK_POINTER_NWORDS; break; case FDEFN_WIDETAG: -- 2.11.4.GIT