diff options
author | Jason Evans <jasone@canonware.com> | 2017-04-25 00:28:55 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-04-25 03:37:16 (GMT) |
commit | c67c3e4a63277718b9d137a38663c6ae324c99aa (patch) | |
tree | 18d2f1f3a5eaaa0b5549c64691e6ed16c3c9f47c /include | |
parent | e2cc6280ed96e2e6a2754d4e7187296e377d9548 (diff) | |
download | jemalloc-c67c3e4a63277718b9d137a38663c6ae324c99aa.zip jemalloc-c67c3e4a63277718b9d137a38663c6ae324c99aa.tar.gz jemalloc-c67c3e4a63277718b9d137a38663c6ae324c99aa.tar.bz2 |
Replace --disable-munmap with opt.munmap.
Control use of munmap(2) via a run-time option rather than a
compile-time option (with the same per platform default). The old
behavior of --disable-munmap can be achieved with
--with-malloc-conf=munmap:false.
This partially resolves #580.
Diffstat (limited to 'include')
4 files changed, 10 insertions, 14 deletions
diff --git a/include/jemalloc/internal/arena_structs_b.h b/include/jemalloc/internal/arena_structs_b.h index ecc59d3..6b83e52 100644 --- a/include/jemalloc/internal/arena_structs_b.h +++ b/include/jemalloc/internal/arena_structs_b.h @@ -230,10 +230,10 @@ struct arena_s { /* * Next extent size class in a growing series to use when satisfying a - * request via the extent hooks (only if !config_munmap). This limits - * the number of disjoint virtual memory ranges so that extent merging - * can be effective even if multiple arenas' extent allocation requests - * are highly interleaved. + * request via the extent hooks (only if !opt_munmap). This limits the + * number of disjoint virtual memory ranges so that extent merging can + * be effective even if multiple arenas' extent allocation requests are + * highly interleaved. * * Synchronization: atomic. */ diff --git a/include/jemalloc/internal/extent_mmap_externs.h b/include/jemalloc/internal/extent_mmap_externs.h index 5917b53..e5bc811 100644 --- a/include/jemalloc/internal/extent_mmap_externs.h +++ b/include/jemalloc/internal/extent_mmap_externs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_EXTENT_MMAP_EXTERNS_H #define JEMALLOC_INTERNAL_EXTENT_MMAP_EXTERNS_H +extern bool opt_munmap; + void *extent_alloc_mmap(void *new_addr, size_t size, size_t alignment, bool *zero, bool *commit); bool extent_dalloc_mmap(void *addr, size_t size); diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h.in b/include/jemalloc/internal/jemalloc_internal_defs.h.in index c22e530..8f7c42b 100644 --- a/include/jemalloc/internal/jemalloc_internal_defs.h.in +++ b/include/jemalloc/internal/jemalloc_internal_defs.h.in @@ -192,9 +192,10 @@ #undef JEMALLOC_MAPS_COALESCE /* - * If defined, use munmap() to unmap freed extents, rather than storing them for - * later reuse. This is disabled by default on Linux because common sequences - * of mmap()/munmap() calls will cause virtual memory map holes. + * If defined, use munmap() to unmap freed extents by default, rather than + * storing them for later reuse. This is disabled on 64-bit Linux because + * common sequences of mmap()/munmap() calls will cause virtual memory map + * holes. */ #undef JEMALLOC_MUNMAP diff --git a/include/jemalloc/internal/jemalloc_preamble.h.in b/include/jemalloc/internal/jemalloc_preamble.h.in index 79827fc..bc0ca64 100644 --- a/include/jemalloc/internal/jemalloc_preamble.h.in +++ b/include/jemalloc/internal/jemalloc_preamble.h.in @@ -98,13 +98,6 @@ static const bool maps_coalesce = false #endif ; -static const bool config_munmap = -#ifdef JEMALLOC_MUNMAP - true -#else - false -#endif - ; static const bool config_stats = #ifdef JEMALLOC_STATS true |