Implement malloc_vsnprintf().

Implement malloc_vsnprintf() (a subset of vsnprintf(3)) as well as
several other printing functions based on it, so that formatted printing
can be relied upon without concern for inducing a dependency on floating
point runtime support.  Replace malloc_write() calls with
malloc_*printf() where doing so simplifies the code.

Add name mangling for library-private symbols in the data and BSS
sections.  Adjust CONF_HANDLE_*() macros in malloc_conf_init() to expose
all opt_* variable use to cpp so that proper mangling occurs.
This commit is contained in:
Jason Evans
2012-03-06 14:57:45 -08:00
parent 4507f34628
commit d81e4bdd5c
17 changed files with 958 additions and 570 deletions

View File

@@ -1,8 +1,6 @@
/******************************************************************************/
#ifdef JEMALLOC_H_TYPES
#define UMAX2S_BUFSIZE 65
typedef struct tcache_bin_stats_s tcache_bin_stats_t;
typedef struct malloc_bin_stats_s malloc_bin_stats_t;
typedef struct malloc_large_stats_s malloc_large_stats_t;
@@ -135,11 +133,6 @@ extern bool opt_stats_print;
extern size_t stats_cactive;
char *u2s(uint64_t x, unsigned base, char *s);
void malloc_cprintf(void (*write)(void *, const char *), void *cbopaque,
const char *format, ...) JEMALLOC_ATTR(format(printf, 3, 4));
void malloc_printf(const char *format, ...)
JEMALLOC_ATTR(format(printf, 1, 2));
void stats_print(void (*write)(void *, const char *), void *cbopaque,
const char *opts);