mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-16 01:46:23 +03:00
Implement arena.<i>.destroy .
Add MALLCTL_ARENAS_DESTROYED for accessing destroyed arena stats as an analogue to MALLCTL_ARENAS_ALL. This resolves #382.
This commit is contained in:
parent
3f291d59ad
commit
edf1bafb2b
16 changed files with 616 additions and 136 deletions
21
src/extent.c
21
src/extent.c
|
|
@ -1039,11 +1039,11 @@ extent_dalloc_default(extent_hooks_t *extent_hooks, void *addr, size_t size,
|
|||
return (extent_dalloc_default_impl(addr, size));
|
||||
}
|
||||
|
||||
void
|
||||
extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena,
|
||||
bool
|
||||
extent_dalloc_wrapper_try(tsdn_t *tsdn, arena_t *arena,
|
||||
extent_hooks_t **r_extent_hooks, extent_t *extent)
|
||||
{
|
||||
bool err, zeroed;
|
||||
bool err;
|
||||
|
||||
assert(extent_base_get(extent) != NULL);
|
||||
assert(extent_size_get(extent) != 0);
|
||||
|
|
@ -1067,10 +1067,21 @@ extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena,
|
|||
extent_committed_get(extent), arena_ind_get(arena)));
|
||||
}
|
||||
|
||||
if (!err) {
|
||||
if (!err)
|
||||
extent_dalloc(tsdn, arena, extent);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
void
|
||||
extent_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena,
|
||||
extent_hooks_t **r_extent_hooks, extent_t *extent)
|
||||
{
|
||||
bool zeroed;
|
||||
|
||||
if (!extent_dalloc_wrapper_try(tsdn, arena, r_extent_hooks, extent))
|
||||
return;
|
||||
}
|
||||
|
||||
extent_reregister(tsdn, extent);
|
||||
/* Try to decommit; purge if that fails. */
|
||||
if (!extent_committed_get(extent))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue