summaryrefslogtreecommitdiffstats
path: root/src/chunk_dss.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2014-04-15 19:09:48 (GMT)
committerJason Evans <je@fb.com>2014-04-15 19:09:48 (GMT)
commit4d434adb146375ad17f0d5e994ed5728d2942e3f (patch)
treef819a7cef393ab203a738a1da01cb6223675f8de /src/chunk_dss.c
parent644d414bc9ab52efbbf7ebeb350170106ec1f937 (diff)
downloadjemalloc-4d434adb146375ad17f0d5e994ed5728d2942e3f.zip
jemalloc-4d434adb146375ad17f0d5e994ed5728d2942e3f.tar.gz
jemalloc-4d434adb146375ad17f0d5e994ed5728d2942e3f.tar.bz2
Make dss non-optional, and fix an "arena.<i>.dss" mallctl bug.
Make dss non-optional on all platforms which support sbrk(2). Fix the "arena.<i>.dss" mallctl to return an error if "primary" or "secondary" precedence is specified, but sbrk(2) is not supported.
Diffstat (limited to 'src/chunk_dss.c')
-rw-r--r--src/chunk_dss.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/chunk_dss.c b/src/chunk_dss.c
index 510bb8b..36133f1 100644
--- a/src/chunk_dss.c
+++ b/src/chunk_dss.c
@@ -32,7 +32,7 @@ static void *
chunk_dss_sbrk(intptr_t increment)
{
-#ifdef JEMALLOC_HAVE_SBRK
+#ifdef JEMALLOC_DSS
return (sbrk(increment));
#else
not_implemented();
@@ -45,7 +45,7 @@ chunk_dss_prec_get(void)
{
dss_prec_t ret;
- if (config_dss == false)
+ if (have_dss == false)
return (dss_prec_disabled);
malloc_mutex_lock(&dss_mtx);
ret = dss_prec_default;
@@ -57,8 +57,8 @@ bool
chunk_dss_prec_set(dss_prec_t dss_prec)
{
- if (config_dss == false)
- return (true);
+ if (have_dss == false)
+ return (dss_prec != dss_prec_disabled);
malloc_mutex_lock(&dss_mtx);
dss_prec_default = dss_prec;
malloc_mutex_unlock(&dss_mtx);
@@ -70,7 +70,7 @@ chunk_alloc_dss(size_t size, size_t alignment, bool *zero)
{
void *ret;
- cassert(config_dss);
+ cassert(have_dss);
assert(size > 0 && (size & chunksize_mask) == 0);
assert(alignment > 0 && (alignment & chunksize_mask) == 0);
@@ -143,7 +143,7 @@ chunk_in_dss(void *chunk)
{
bool ret;
- cassert(config_dss);
+ cassert(have_dss);
malloc_mutex_lock(&dss_mtx);
if ((uintptr_t)chunk >= (uintptr_t)dss_base
@@ -160,7 +160,7 @@ bool
chunk_dss_boot(void)
{
- cassert(config_dss);
+ cassert(have_dss);
if (malloc_mutex_init(&dss_mtx))
return (true);
@@ -175,7 +175,7 @@ void
chunk_dss_prefork(void)
{
- if (config_dss)
+ if (have_dss)
malloc_mutex_prefork(&dss_mtx);
}
@@ -183,7 +183,7 @@ void
chunk_dss_postfork_parent(void)
{
- if (config_dss)
+ if (have_dss)
malloc_mutex_postfork_parent(&dss_mtx);
}
@@ -191,7 +191,7 @@ void
chunk_dss_postfork_child(void)
{
- if (config_dss)
+ if (have_dss)
malloc_mutex_postfork_child(&dss_mtx);
}