MADV_DO[NOT]DUMP support equivalence on FreeBSD.
This commit is contained in:
committed by
David Goldblatt
parent
180b843159
commit
d2d941017b
@@ -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
|
||||
|
Reference in New Issue
Block a user