From 14d27241d27d161c1b1057e7a50af5aa0cf466c2 Mon Sep 17 00:00:00 2001 From: ivmai Date: Tue, 10 May 2011 11:07:12 +0000 Subject: [PATCH] 2011-05-10 Ivan Maidanski * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define unconditionally (do not test GC_I_HIDE_POINTERS); update the comment. * include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to GC_HIDE/REVEAL_POINTER, respectively. * include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define. * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto. --- ChangeLog | 10 ++++++++++ include/gc.h | 26 ++++++++++++-------------- include/private/gc_pmark.h | 3 --- include/private/gc_priv.h | 1 - 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49036fd5..e2108958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-05-10 Ivan Maidanski + + * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define + unconditionally (do not test GC_I_HIDE_POINTERS); update the + comment. + * include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to + GC_HIDE/REVEAL_POINTER, respectively. + * include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define. + * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto. + 2011-05-10 Ivan Maidanski * include/gc.h (GC_register_my_thread): Refine the comment. diff --git a/include/gc.h b/include/gc.h index ae80fd95..e94a943e 100644 --- a/include/gc.h +++ b/include/gc.h @@ -958,20 +958,18 @@ GC_API void GC_CALLBACK GC_ignore_warn_proc(char *, GC_word); /* Note that putting pointers in atomic objects or in */ /* non-pointer slots of "typed" objects is equivalent to */ /* disguising them in this way, and may have other advantages. */ -#if defined(I_HIDE_POINTERS) || defined(GC_I_HIDE_POINTERS) - typedef GC_word GC_hidden_pointer; -# define HIDE_POINTER(p) (~(GC_hidden_pointer)(p)) -# define REVEAL_POINTER(p) ((void *)HIDE_POINTER(p)) - /* Converting a hidden pointer to a real pointer requires verifying */ - /* that the object still exists. This involves acquiring the */ - /* allocator lock to avoid a race with the collector. */ -#endif /* I_HIDE_POINTERS */ - -/* The GC-prefixed symbols are preferred for new code (I_HIDE_POINTERS, */ -/* HIDE_POINTER and REVEAL_POINTER remain for compatibility). */ -#ifdef GC_I_HIDE_POINTERS -# define GC_HIDE_POINTER(p) HIDE_POINTER(p) -# define GC_REVEAL_POINTER(p) REVEAL_POINTER(p) +typedef GC_word GC_hidden_pointer; +#define GC_HIDE_POINTER(p) (~(GC_hidden_pointer)(p)) +/* Converting a hidden pointer to a real pointer requires verifying */ +/* that the object still exists. This involves acquiring the */ +/* allocator lock to avoid a race with the collector. */ +#define GC_REVEAL_POINTER(p) ((void *)GC_HIDE_POINTER(p)) + +#ifdef I_HIDE_POINTERS + /* This exists only for compatibility (the GC-prefixed symbols are */ + /* preferred for new code). */ +# define HIDE_POINTER(p) GC_HIDE_POINTER(p) +# define REVEAL_POINTER(p) GC_REVEAL_POINTER(p) #endif typedef void * (GC_CALLBACK * GC_fn_type)(void * /* client_data */); diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index d99e0b7f..30640505 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -35,9 +35,6 @@ #endif #ifndef GC_MARK_H -# ifndef GC_H -# define GC_I_HIDE_POINTERS /* to get GC_HIDE_POINTER() and friends */ -# endif # include "../gc_mark.h" #endif diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index c02def1b..84d40f54 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -43,7 +43,6 @@ # endif #ifndef GC_H -# define GC_I_HIDE_POINTERS /* to get GC_HIDE_POINTER() and friends */ # include "../gc.h" #endif -- 2.50.1