diff options
author | David Goldblatt <davidgoldblatt@fb.com> | 2017-09-18 22:10:01 (GMT) |
---|---|---|
committer | David Goldblatt <davidtgoldblatt@gmail.com> | 2017-10-16 22:35:49 (GMT) |
commit | bbaa72422bb086933890a125fd58bf199fe26f2d (patch) | |
tree | 8e33faa50345bba8a4864b7f86d77ead335769e1 /src | |
parent | ccd09050aa53d083fe0b45d4704b1fe95fb00c92 (diff) | |
download | jemalloc-bbaa72422bb086933890a125fd58bf199fe26f2d.zip jemalloc-bbaa72422bb086933890a125fd58bf199fe26f2d.tar.gz jemalloc-bbaa72422bb086933890a125fd58bf199fe26f2d.tar.bz2 |
Add pages_dontdump and pages_dodump.
This will, eventually, enable us to avoid dumping eden regions.
Diffstat (limited to 'src')
-rw-r--r-- | src/pages.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pages.c b/src/pages.c index e8112f7..5e1043d 100644 --- a/src/pages.c +++ b/src/pages.c @@ -328,6 +328,29 @@ pages_nohuge(void *addr, size_t size) { #endif } +bool +pages_dontdump(void *addr, size_t size) { + assert(PAGE_ADDR2BASE(addr) == addr); + assert(PAGE_CEILING(size) == size); +#ifdef JEMALLOC_MADVISE_DONTDUMP + return madvise(addr, size, MADV_DONTDUMP) != 0; +#else + return false; +#endif +} + +bool +pages_dodump(void *addr, size_t size) { + assert(PAGE_ADDR2BASE(addr) == addr); + assert(PAGE_CEILING(size) == size); +#ifdef JEMALLOC_MADVISE_DONTDUMP + return madvise(addr, size, MADV_DODUMP) != 0; +#else + return false; +#endif +} + + static size_t os_page_detect(void) { #ifdef _WIN32 |