Add --with-mangling.

Add the --with-mangling configure option, which can be used to specify
name mangling on a per public symbol basis that takes precedence over
--with-jemalloc-prefix.

Expose the memalign() and valloc() overrides even if
--with-jemalloc-prefix is specified.  This change does no real harm, and
simplifies the code.
This commit is contained in:
Jason Evans
2012-03-01 17:19:20 -08:00
parent 166a745b39
commit 0a5489e37d
15 changed files with 265 additions and 176 deletions

View File

@@ -74,7 +74,7 @@ int ctl_bymib(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
bool ctl_boot(void);
#define xmallctl(name, oldp, oldlenp, newp, newlen) do { \
if (JEMALLOC_P(mallctl)(name, oldp, oldlenp, newp, newlen) \
if (je_mallctl(name, oldp, oldlenp, newp, newlen) \
!= 0) { \
malloc_write("<jemalloc>: Failure in xmallctl(\""); \
malloc_write(name); \
@@ -84,7 +84,7 @@ bool ctl_boot(void);
} while (0)
#define xmallctlnametomib(name, mibp, miblenp) do { \
if (JEMALLOC_P(mallctlnametomib)(name, mibp, miblenp) != 0) { \
if (je_mallctlnametomib(name, mibp, miblenp) != 0) { \
malloc_write( \
"<jemalloc>: Failure in xmallctlnametomib(\""); \
malloc_write(name); \
@@ -94,7 +94,7 @@ bool ctl_boot(void);
} while (0)
#define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do { \
if (JEMALLOC_P(mallctlbymib)(mib, miblen, oldp, oldlenp, newp, \
if (je_mallctlbymib(mib, miblen, oldp, oldlenp, newp, \
newlen) != 0) { \
malloc_write( \
"<jemalloc>: Failure in xmallctlbymib()\n"); \

View File

@@ -30,7 +30,7 @@
#include <pthread.h>
#include <math.h>
#define JEMALLOC_MANGLE
#define JEMALLOC_NO_DEMANGLE
#include "../jemalloc@install_suffix@.h"
#include "jemalloc/internal/private_namespace.h"
@@ -149,7 +149,7 @@ static const bool config_ivsalloc =
#include "jemalloc/internal/qr.h"
#include "jemalloc/internal/ql.h"
extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s);
extern void (*je_malloc_message)(void *wcbopaque, const char *s);
/*
* Define a custom assert() in order to reduce the chances of deadlock during
@@ -618,13 +618,13 @@ sa2u(size_t size, size_t alignment, size_t *run_size_p)
/*
* Wrapper around malloc_message() that avoids the need for
* JEMALLOC_P(malloc_message)(...) throughout the code.
* je_malloc_message(...) throughout the code.
*/
JEMALLOC_INLINE void
malloc_write(const char *s)
{
JEMALLOC_P(malloc_message)(NULL, s);
je_malloc_message(NULL, s);
}
/*