mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-24 00:41:11 -04:00
add wrapper for madvise
This commit is contained in:
parent
73b78a8adb
commit
b84af9b499
3 changed files with 11 additions and 2 deletions
|
@ -1773,7 +1773,7 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) {
|
|||
for (size_t i = 0; i < slab_quarantine_random_length; i++) {
|
||||
void *p = c->quarantine_random[i];
|
||||
if (p != NULL) {
|
||||
madvise(p, size, MADV_DONTNEED);
|
||||
memory_purge(p, size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1783,7 +1783,7 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) {
|
|||
for (size_t i = 0; i < slab_quarantine_queue_length; i++) {
|
||||
void *p = c->quarantine_queue[i];
|
||||
if (p != NULL) {
|
||||
madvise(p, size, MADV_DONTNEED);
|
||||
memory_purge(p, size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue