GC_API void GC_CALL GC_push_finalizer_structures(void)
{
- GC_ASSERT((word)&GC_dl_hashtbl.head % sizeof(word) == 0);
- GC_ASSERT((word)&GC_fo_head % sizeof(word) == 0);
- GC_ASSERT((word)&GC_finalize_now % sizeof(word) == 0);
-
+ GC_ASSERT((word)&GC_dl_hashtbl.head % sizeof(word) == 0);
+ GC_ASSERT((word)&GC_fo_head % sizeof(word) == 0);
+ GC_ASSERT((word)&GC_finalize_now % sizeof(word) == 0);
# ifndef GC_LONG_REFS_NOT_NEEDED
GC_ASSERT((word)&GC_ll_hashtbl.head % sizeof(word) == 0);
- GC_push_all((ptr_t)(&GC_ll_hashtbl.head),
- (ptr_t)(&GC_ll_hashtbl.head) + sizeof(word));
+ GC_PUSH_ALL_SYM(GC_ll_hashtbl.head);
# endif
-
- GC_push_all((ptr_t)(&GC_dl_hashtbl.head),
- (ptr_t)(&GC_dl_hashtbl.head) + sizeof(word));
- GC_push_all((ptr_t)(&GC_fo_head), (ptr_t)(&GC_fo_head) + sizeof(word));
- GC_push_all((ptr_t)(&GC_finalize_now),
- (ptr_t)(&GC_finalize_now) + sizeof(word));
+ GC_PUSH_ALL_SYM(GC_dl_hashtbl.head);
+ GC_PUSH_ALL_SYM(GC_fo_head);
+ GC_PUSH_ALL_SYM(GC_finalize_now);
}
/* Double the size of a hash table. *size_ptr is the log of its current */
# define GC_PUSH_CONDITIONAL(b, t, all) GC_push_all((ptr_t)(b), (ptr_t)(t))
#endif
+#define GC_PUSH_ALL_SYM(sym) \
+ GC_push_all((ptr_t)&(sym), (ptr_t)&(sym) + sizeof(sym))
+
GC_INNER void GC_push_all_stack(ptr_t b, ptr_t t);
/* As GC_push_all but consider */
/* interior pointers as valid. */
void GC_push_thread_structures(void)
{
GC_ASSERT(I_HOLD_LOCK());
- GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads));
+ GC_PUSH_ALL_SYM(GC_threads);
# if defined(THREAD_LOCAL_ALLOC)
- GC_push_all((ptr_t)(&GC_thread_key),
- (ptr_t)(&GC_thread_key) + sizeof(GC_thread_key));
+ GC_PUSH_ALL_SYM(GC_thread_key);
# endif
}
STATIC void GC_push_typed_structures_proc(void)
{
- GC_push_all((ptr_t)&GC_ext_descriptors,
- (ptr_t)&GC_ext_descriptors + sizeof(word));
+ GC_PUSH_ALL_SYM(GC_ext_descriptors);
}
/* Add a multiword bitmap to GC_ext_descriptors arrays. Return */
} else
# endif
/* else */ {
- GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads));
+ GC_PUSH_ALL_SYM(GC_threads);
}
# if defined(THREAD_LOCAL_ALLOC)
- GC_push_all((ptr_t)(&GC_thread_key),
- (ptr_t)(&GC_thread_key) + sizeof(GC_thread_key));
+ GC_PUSH_ALL_SYM(GC_thread_key);
/* Just in case we ever use our own TLS implementation. */
# endif
}