mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-23 04:15:39 +03:00
Modify extent hook functions to take an (extent_t *) argument.
This facilitates the application accessing its own extent allocator metadata during hook invocations. This resolves #259.
This commit is contained in:
parent
6f29a83924
commit
f8f0542194
10 changed files with 312 additions and 315 deletions
16
src/ctl.c
16
src/ctl.c
|
|
@ -1646,15 +1646,15 @@ arena_i_extent_hooks_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
|
|||
if (arena_ind < narenas_total_get() && (arena =
|
||||
arena_get(tsd_tsdn(tsd), arena_ind, false)) != NULL) {
|
||||
if (newp != NULL) {
|
||||
extent_hooks_t old_extent_hooks, new_extent_hooks;
|
||||
WRITE(new_extent_hooks, extent_hooks_t);
|
||||
old_extent_hooks = extent_hooks_set(tsd_tsdn(tsd),
|
||||
arena, &new_extent_hooks);
|
||||
READ(old_extent_hooks, extent_hooks_t);
|
||||
extent_hooks_t *old_extent_hooks, *new_extent_hooks;
|
||||
WRITE(new_extent_hooks, extent_hooks_t *);
|
||||
old_extent_hooks = extent_hooks_set(arena,
|
||||
new_extent_hooks);
|
||||
READ(old_extent_hooks, extent_hooks_t *);
|
||||
} else {
|
||||
extent_hooks_t old_extent_hooks =
|
||||
extent_hooks_get(tsd_tsdn(tsd), arena);
|
||||
READ(old_extent_hooks, extent_hooks_t);
|
||||
extent_hooks_t *old_extent_hooks =
|
||||
extent_hooks_get(arena);
|
||||
READ(old_extent_hooks, extent_hooks_t *);
|
||||
}
|
||||
} else {
|
||||
ret = EFAULT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue