From 967bad690c7a250fdc1f7eb1b3ce2a80700c02d4 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Wed, 3 May 2017 16:24:23 -0400 Subject: [PATCH] Define layout_bitmap_logbitp() in a header --- src/runtime/gc-internal.h | 10 ++++++++++ src/runtime/traceroot.c | 12 +----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index aa8bd6a10..aeb77d350 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -315,4 +315,14 @@ static inline boolean weak_pointer_breakable_p(struct weak_pointer *wp) ); } +/// Same as Lisp LOGBITP, except no negative bignums allowed. +static inline boolean layout_bitmap_logbitp(int index, lispobj bitmap) +{ + if (fixnump(bitmap)) + return (index < (N_WORD_BITS - N_FIXNUM_TAG_BITS)) + ? (bitmap >> (index+N_FIXNUM_TAG_BITS)) & 1 + : (sword_t)bitmap < 0; + return positive_bignum_logbitp(index, (struct bignum*)native_pointer(bitmap)); +} + #endif /* _GC_INTERNAL_H_ */ diff --git a/src/runtime/traceroot.c b/src/runtime/traceroot.c index 8d75addc6..a2f50e769 100644 --- a/src/runtime/traceroot.c +++ b/src/runtime/traceroot.c @@ -121,16 +121,6 @@ static lispobj canonical_obj(lispobj obj) return obj; } -/// Same as Lisp LOGBITP, except no negative bignums allowed. -static inline boolean layout_bitmap_logbitp(int index, lispobj bitmap) -{ - if (fixnump(bitmap)) - return (index < (N_WORD_BITS - N_FIXNUM_TAG_BITS)) - ? (bitmap >> (index+N_FIXNUM_TAG_BITS)) & 1 - : (sword_t)bitmap < 0; - return positive_bignum_logbitp(index, (struct bignum*)native_pointer(bitmap)); -} - /* Return the word index of the pointer in 'source' which references 'target'. * Return -1 on failure. (This is an error if it happens) */ @@ -622,7 +612,7 @@ static uword_t build_refs(lispobj* where, lispobj* end, struct scan_state* ss) { lispobj layout, bitmap, fun; - int nwords, scan_limit, i, j; + sword_t nwords, scan_limit, i, j; uword_t n_objects = 0, n_scanned_words = 0, n_immediates = 0, n_pointers = 0; -- 2.11.4.GIT