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:
parent
9b41542f4d
commit
475461b7a0
1 changed files with 2 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue