1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-05 11:40:20 +02:00

Use `GC_base ()' to determine whether a pointer points to the heap.

* 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).
This commit is contained in:
Ludovic Courtès 2009-02-01 21:59:32 +01:00
parent 9b41542f4d
commit 475461b7a0

View file

@ -46,12 +46,9 @@ typedef void *GC_PTR;
#endif
#include <gc/gc_mark.h>
/* 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