aboutsummaryrefslogtreecommitdiffstats
path: root/src/base.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-10-12 11:49:19 -0700
committerJason Evans <jasone@canonware.com>2016-10-12 11:55:43 -0700
commit9acd5cf178eca9bc8a7f36a8c392b799a120bcbf (patch)
treeb32689315e91e15519359ab6e53f7a9b13e8b3b0 /src/base.c
parent63b5657aa566ceab270ff6e9d4f366233d2d0b79 (diff)
downloadplatform_external_jemalloc_new-9acd5cf178eca9bc8a7f36a8c392b799a120bcbf.tar.gz
platform_external_jemalloc_new-9acd5cf178eca9bc8a7f36a8c392b799a120bcbf.tar.bz2
platform_external_jemalloc_new-9acd5cf178eca9bc8a7f36a8c392b799a120bcbf.zip
Remove all vestiges of chunks.
Remove mallctls: - opt.lg_chunk - stats.cactive This resolves #464.
Diffstat (limited to 'src/base.c')
-rw-r--r--src/base.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/base.c b/src/base.c
index 667786e1..9c3f36cd 100644
--- a/src/base.c
+++ b/src/base.c
@@ -41,7 +41,7 @@ static extent_t *
base_extent_alloc(tsdn_t *tsdn, size_t minsize)
{
extent_t *extent;
- size_t csize, nsize;
+ size_t esize, nsize;
void *addr;
malloc_mutex_assert_owner(tsdn, &base_mtx);
@@ -49,7 +49,7 @@ base_extent_alloc(tsdn_t *tsdn, size_t minsize)
extent = base_extent_try_alloc(tsdn);
/* Allocate enough space to also carve an extent out if necessary. */
nsize = (extent == NULL) ? CACHELINE_CEILING(sizeof(extent_t)) : 0;
- csize = CHUNK_CEILING(minsize + nsize);
+ esize = PAGE_CEILING(minsize + nsize);
/*
* Directly call extent_alloc_mmap() because it's critical to allocate
* untouched demand-zeroed virtual memory.
@@ -57,24 +57,24 @@ base_extent_alloc(tsdn_t *tsdn, size_t minsize)
{
bool zero = true;
bool commit = true;
- addr = extent_alloc_mmap(NULL, csize, PAGE, &zero, &commit);
+ addr = extent_alloc_mmap(NULL, esize, PAGE, &zero, &commit);
}
if (addr == NULL) {
if (extent != NULL)
base_extent_dalloc(tsdn, extent);
return (NULL);
}
- base_mapped += csize;
+ base_mapped += esize;
if (extent == NULL) {
extent = (extent_t *)addr;
addr = (void *)((uintptr_t)addr + nsize);
- csize -= nsize;
+ esize -= nsize;
if (config_stats) {
base_allocated += nsize;
base_resident += PAGE_CEILING(nsize);
}
}
- extent_init(extent, NULL, addr, csize, 0, true, true, true, false);
+ extent_init(extent, NULL, addr, esize, 0, true, true, true, false);
return (extent);
}