diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-11-25 12:07:13 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2015-05-11 18:59:31 +0300 |
commit | 25d17297f9e258185e2f8ca29029ef3c89dba83d (patch) | |
tree | 3db7fd4e449d9ed6b6b1624678634d721ede5d2a /malloc.c | |
parent | 01d2c1b9d2e14cb7492734346c224e764db483ed (diff) | |
download | bdwgc-25d17297f9e258185e2f8ca29029ef3c89dba83d.tar.gz |
Recognize REDIRECT_MALLOC_IN_HEADER macro
* include/private/gcconfig.h: Do not issue error on REDIRECT_MALLOC
and THREADS if REDIRECT_MALLOC_IN_HEADER defined.
* malloc.c (malloc, calloc, strdup, strndup, free): Do not define if
REDIRECT_MALLOC_IN_HEADER.
* mallocx.c (realloc): Likewise.
Conflicts:
include/gc.h
include/private/gcconfig.h
malloc.c
mallocx.c
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -351,6 +351,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_uncollectable(size_t lb) /* but it is admittedly quite ugly. */ # define GC_debug_malloc_replacement(lb) GC_debug_malloc(lb, GC_DBG_EXTRAS) +#if !defined(REDIRECT_MALLOC_IN_HEADER) void * malloc(size_t lb) { /* It might help to manually inline the GC_malloc call here. */ @@ -464,6 +465,8 @@ void * calloc(size_t n, size_t lb) } #endif /* !strndup */ +#endif /* !REDIRECT_MALLOC_IN_HEADER */ + #undef GC_debug_malloc_replacement #endif /* REDIRECT_MALLOC */ @@ -574,7 +577,7 @@ GC_API void GC_CALL GC_free(void * p) # define REDIRECT_FREE GC_free #endif -#ifdef REDIRECT_FREE +#if defined(REDIRECT_FREE) && !defined(REDIRECT_MALLOC_IN_HEADER) void free(void * p) { # if defined(GC_LINUX_THREADS) && !defined(USE_PROC_FOR_LIBRARIES) |