mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-05 01:46:16 +03:00
MADV_DO[NOT]DUMP support equivalence on FreeBSD.
This commit is contained in:
parent
180b843159
commit
d2d941017b
3 changed files with 21 additions and 2 deletions
|
|
@ -413,8 +413,10 @@ bool
|
|||
pages_dontdump(void *addr, size_t size) {
|
||||
assert(PAGE_ADDR2BASE(addr) == addr);
|
||||
assert(PAGE_CEILING(size) == size);
|
||||
#ifdef JEMALLOC_MADVISE_DONTDUMP
|
||||
#if defined(JEMALLOC_MADVISE_DONTDUMP)
|
||||
return madvise(addr, size, MADV_DONTDUMP) != 0;
|
||||
#elif defined(JEMALLOC_MADVISE_NOCORE)
|
||||
return madvise(addr, size, MADV_NOCORE) != 0;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
@ -424,8 +426,10 @@ bool
|
|||
pages_dodump(void *addr, size_t size) {
|
||||
assert(PAGE_ADDR2BASE(addr) == addr);
|
||||
assert(PAGE_CEILING(size) == size);
|
||||
#ifdef JEMALLOC_MADVISE_DONTDUMP
|
||||
#if defined(JEMALLOC_MADVISE_DONTDUMP)
|
||||
return madvise(addr, size, MADV_DODUMP) != 0;
|
||||
#elif defined(JEMALLOC_MADVISE_NOCORE)
|
||||
return madvise(addr, size, MADV_CORE) != 0;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue