mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Add a pages_purge function to wrap madvise(JEMALLOC_MADV_PURGE) calls
This will be used to implement the feature on mingw, which doesn't have madvise.
This commit is contained in:
@@ -676,8 +676,8 @@ arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk)
|
||||
if (config_debug)
|
||||
ndirty -= npages;
|
||||
|
||||
madvise((void *)((uintptr_t)chunk + (pageind << LG_PAGE)),
|
||||
(npages << LG_PAGE), JEMALLOC_MADV_PURGE);
|
||||
pages_purge((void *)((uintptr_t)chunk + (pageind << LG_PAGE)),
|
||||
(npages << LG_PAGE));
|
||||
if (config_stats)
|
||||
nmadvise++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user