Add pages_dontdump and pages_dodump.
This will, eventually, enable us to avoid dumping eden regions.
This commit is contained in:
parent
ccd09050aa
commit
bbaa72422b
@ -69,6 +69,8 @@ bool pages_purge_lazy(void *addr, size_t size);
|
|||||||
bool pages_purge_forced(void *addr, size_t size);
|
bool pages_purge_forced(void *addr, size_t size);
|
||||||
bool pages_huge(void *addr, size_t size);
|
bool pages_huge(void *addr, size_t size);
|
||||||
bool pages_nohuge(void *addr, size_t size);
|
bool pages_nohuge(void *addr, size_t size);
|
||||||
|
bool pages_dontdump(void *addr, size_t size);
|
||||||
|
bool pages_dodump(void *addr, size_t size);
|
||||||
bool pages_boot(void);
|
bool pages_boot(void);
|
||||||
|
|
||||||
#endif /* JEMALLOC_INTERNAL_PAGES_EXTERNS_H */
|
#endif /* JEMALLOC_INTERNAL_PAGES_EXTERNS_H */
|
||||||
|
23
src/pages.c
23
src/pages.c
@ -328,6 +328,29 @@ pages_nohuge(void *addr, size_t size) {
|
|||||||
#endif
|
#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
|
static size_t
|
||||||
os_page_detect(void) {
|
os_page_detect(void) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
Loading…
Reference in New Issue
Block a user