diff options
| author | jackpoz <giacomopoz@gmail.com> | 2017-11-19 20:23:00 +0100 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2017-11-25 13:18:21 +0100 |
| commit | 92cd9bd70db460fdce4af0596cf9d8ee3c3abad5 (patch) | |
| tree | 28fe47305cb0a70da890fb1eac9cc0e3f10f6e5f /dep/jemalloc/src/extent_mmap.c | |
| parent | eba1c1ff97afeb761a0130ea5989643ffbbda154 (diff) | |
Dep/Jemalloc: Update to Jemalloc 5.0.1
Diffstat (limited to 'dep/jemalloc/src/extent_mmap.c')
| -rw-r--r-- | dep/jemalloc/src/extent_mmap.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dep/jemalloc/src/extent_mmap.c b/dep/jemalloc/src/extent_mmap.c new file mode 100644 index 00000000000..8d607dc8039 --- /dev/null +++ b/dep/jemalloc/src/extent_mmap.c @@ -0,0 +1,42 @@ +#define JEMALLOC_EXTENT_MMAP_C_ +#include "jemalloc/internal/jemalloc_preamble.h" +#include "jemalloc/internal/jemalloc_internal_includes.h" + +#include "jemalloc/internal/assert.h" +#include "jemalloc/internal/extent_mmap.h" + +/******************************************************************************/ +/* Data. */ + +bool opt_retain = +#ifdef JEMALLOC_RETAIN + true +#else + false +#endif + ; + +/******************************************************************************/ + +void * +extent_alloc_mmap(void *new_addr, size_t size, size_t alignment, bool *zero, + bool *commit) { + void *ret = pages_map(new_addr, size, ALIGNMENT_CEILING(alignment, + PAGE), commit); + if (ret == NULL) { + return NULL; + } + assert(ret != NULL); + if (*commit) { + *zero = true; + } + return ret; +} + +bool +extent_dalloc_mmap(void *addr, size_t size) { + if (!opt_retain) { + pages_unmap(addr, size); + } + return opt_retain; +} |
