From 475461b7a02a5350af7cfb972826e155f3aab3c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 1 Feb 2009 21:59:32 +0100 Subject: [PATCH] Use `GC_base ()' to determine whether a pointer points to the heap. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP): Use `GC_base ()' instead of `GC_{least,greatest}_plausible_heap addr' since the GC does not assume that the heap is contiguous (suggested by Ivan Maidanski and Hans Boehm). --- libguile/boehm-gc.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libguile/boehm-gc.h b/libguile/boehm-gc.h index ba9b56bbf..ab842bc1b 100644 --- a/libguile/boehm-gc.h +++ b/libguile/boehm-gc.h @@ -46,12 +46,9 @@ typedef void *GC_PTR; #endif -#include - /* Return true if PTR points to the heap. */ -#define SCM_I_IS_POINTER_TO_THE_HEAP(ptr) \ - ((void *) (ptr) >= GC_least_plausible_heap_addr \ - && (void *) (ptr) <= GC_greatest_plausible_heap_addr) +#define SCM_I_IS_POINTER_TO_THE_HEAP(ptr) \ + (GC_base (ptr) != NULL) /* Register a disappearing link for the object pointed to by OBJ such that the pointer pointed to be LINK is cleared when OBJ is reclaimed. Do so -- 2.20.1