GC_API void * GC_CALL GC_debug_malloc_replacement(size_t lb)
{
- return GC_debug_malloc(lb, GC_DBG_RA NULL, 0);
+ return GC_debug_malloc(lb, GC_DBG_EXTRAS);
}
GC_API void * GC_CALL GC_debug_realloc_replacement(void *p, size_t lb)
{
- return GC_debug_realloc(p, lb, GC_DBG_RA NULL, 0);
+ return GC_debug_realloc(p, lb, GC_DBG_EXTRAS);
}
/* head. Sz is in granules. */
#ifdef GC_ADD_CALLER
+ /* GC_DBG_EXTRAS is used by GC debug API functions (unlike GC_EXTRAS */
+ /* used by GC debug API macros) thus GC_RETURN_ADDR_PARENT (pointing */
+ /* to client caller) should be used if possible. */
# ifdef GC_RETURN_ADDR_PARENT
-# define GC_DBG_RA GC_RETURN_ADDR_PARENT,
+# define GC_DBG_EXTRAS GC_RETURN_ADDR_PARENT, NULL, 0
# else
-# define GC_DBG_RA GC_RETURN_ADDR,
+# define GC_DBG_EXTRAS GC_RETURN_ADDR, NULL, 0
# endif
#else
-# define GC_DBG_RA /* empty */
+# define GC_DBG_EXTRAS "unknown", 0
#endif
/* We make the GC_clear_stack() call a tail one, hoping to get more of */
/* malloc replacements. Otherwise we end up saving a */
/* meaningless return address in the object. It also speeds things up, */
/* but it is admittedly quite ugly. */
-# define GC_debug_malloc_replacement(lb) \
- GC_debug_malloc(lb, GC_DBG_RA NULL, 0)
+# define GC_debug_malloc_replacement(lb) GC_debug_malloc(lb, GC_DBG_EXTRAS)
void * malloc(size_t lb)
{
/* As with malloc, avoid two levels of extra calls here. */
# define GC_debug_realloc_replacement(p, lb) \
- GC_debug_realloc(p, lb, GC_DBG_RA NULL, 0)
+ GC_debug_realloc(p, lb, GC_DBG_EXTRAS)
void * realloc(void * p, size_t lb)
{