summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-25 12:07:13 +0400
committerIvan Maidanski <ivmai@mail.ru>2015-05-11 18:59:31 +0300
commit25d17297f9e258185e2f8ca29029ef3c89dba83d (patch)
tree3db7fd4e449d9ed6b6b1624678634d721ede5d2a /malloc.c
parent01d2c1b9d2e14cb7492734346c224e764db483ed (diff)
downloadbdwgc-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/malloc.c b/malloc.c
index a4dd437f..3e086573 100644
--- a/malloc.c
+++ b/malloc.c
@@ -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)