openwrt: allocator: Fix recommitted pages not being zeroed when madvise is not available.
Support kernels built without CONFIG_ADVISE_SYSCALLS on small embedded devices.147.0.7727.49
parent
d643d508f3
commit
e1948522f7
|
|
@ -281,6 +281,8 @@ constexpr PA_COMPONENT_EXPORT(
|
|||
PARTITION_ALLOC) bool DecommittedMemoryIsAlwaysZeroed() {
|
||||
#if PA_BUILDFLAG(IS_APPLE)
|
||||
return false;
|
||||
#elif defined(NO_MADVISE_SYSCALL)
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -325,6 +325,9 @@ void DiscardSystemPagesInternal(uintptr_t address, size_t length) {
|
|||
ret = madvise(ptr, length, MADV_DONTNEED);
|
||||
}
|
||||
PA_PCHECK(ret == 0);
|
||||
#elif defined(NO_MADVISE_SYSCALL)
|
||||
static_cast<void>(ptr);
|
||||
static_cast<void>(length);
|
||||
#else // PA_BUILDFLAG(IS_APPLE)
|
||||
// We have experimented with other flags, but with suboptimal results.
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue