mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-16 00:58:20 -05:00
Forward declare mallocx in isc/mem.h
cmocka.h and jemalloc.h/malloc_np.h has conflicting macro definitions. While fixing them with push_macro for only malloc is done below, we only need the non-standard mallocx interface which is easy to just define by ourselves.
This commit is contained in:
parent
41a0ee1071
commit
197de93bdc
1 changed files with 11 additions and 5 deletions
|
|
@ -190,14 +190,20 @@ extern unsigned int isc_mem_defaultflags;
|
|||
* for more information.
|
||||
*/
|
||||
#if HAVE_JEMALLOC
|
||||
#include <jemalloc/jemalloc.h>
|
||||
|
||||
/*
|
||||
* cmocka.h has confliction definitions with the jemalloc header but we only
|
||||
* need the mallocx symbol from jemalloc.
|
||||
*/
|
||||
void *
|
||||
mallocx(size_t size, int flags);
|
||||
|
||||
extern volatile void *isc__mem_malloc;
|
||||
|
||||
#define isc_mem_create(cp) \
|
||||
{ \
|
||||
isc__mem_create((cp)_ISC_MEM_FILELINE); \
|
||||
isc__mem_malloc = mallocx; \
|
||||
#define isc_mem_create(cp) \
|
||||
{ \
|
||||
isc__mem_create((cp)_ISC_MEM_FILELINE); \
|
||||
isc__mem_malloc = mallocx; \
|
||||
ISC_INSIST(CMM_ACCESS_ONCE(isc__mem_malloc) != NULL); \
|
||||
}
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue