Add --with-malloc-conf.

Add --with-malloc-conf, which makes it possible to embed a default
options string during configuration.
This commit is contained in:
Jason Evans 2016-02-07 14:23:22 -08:00 committed by Jason Evans
parent ef349f3f94
commit f829009929
9 changed files with 87 additions and 44 deletions

View file

@ -902,10 +902,13 @@ malloc_conf_init(void)
opt_tcache = false;
}
for (i = 0; i < 3; i++) {
for (i = 0; i < 4; i++) {
/* Get runtime configuration. */
switch (i) {
case 0:
opts = config_malloc_conf;
break;
case 1:
if (je_malloc_conf != NULL) {
/*
* Use options that were compiled into the
@ -918,7 +921,7 @@ malloc_conf_init(void)
opts = buf;
}
break;
case 1: {
case 2: {
int linklen = 0;
#ifndef _WIN32
int saved_errno = errno;
@ -945,7 +948,7 @@ malloc_conf_init(void)
buf[linklen] = '\0';
opts = buf;
break;
} case 2: {
} case 3: {
const char *envname =
#ifdef JEMALLOC_PREFIX
JEMALLOC_CPREFIX"MALLOC_CONF"