mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-25 06:16:27 +03:00
Extent -> Ehooks: Move purge_lazy hook.
This commit is contained in:
parent
f83fdf5336
commit
368baa42ef
4 changed files with 41 additions and 37 deletions
18
src/ehooks.c
18
src/ehooks.c
|
|
@ -126,3 +126,21 @@ ehooks_default_decommit(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
|||
size_t offset, size_t length, unsigned arena_ind) {
|
||||
return ehooks_default_decommit_impl(addr, offset, length);
|
||||
}
|
||||
|
||||
#ifdef PAGES_CAN_PURGE_LAZY
|
||||
bool
|
||||
ehooks_default_purge_lazy_impl(void *addr, size_t offset, size_t length) {
|
||||
return pages_purge_lazy((void *)((uintptr_t)addr + (uintptr_t)offset),
|
||||
length);
|
||||
}
|
||||
|
||||
bool
|
||||
ehooks_default_purge_lazy(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
||||
size_t offset, size_t length, unsigned arena_ind) {
|
||||
assert(addr != NULL);
|
||||
assert((offset & PAGE_MASK) == 0);
|
||||
assert(length != 0);
|
||||
assert((length & PAGE_MASK) == 0);
|
||||
return ehooks_default_purge_lazy_impl(addr, offset, length);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue