mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-26 05:45:49 +03:00
Arena chunk decommit cleanups and fixes.
Decommit arena chunk header during chunk deallocation if the rest of the chunk is decommitted.
This commit is contained in:
parent
4be0c3ca42
commit
de249c8679
5 changed files with 55 additions and 29 deletions
|
|
@ -838,6 +838,7 @@ arena_mapbits_unzeroed_set(arena_chunk_t *chunk, size_t pageind,
|
|||
size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind);
|
||||
size_t mapbits = arena_mapbitsp_read(mapbitsp);
|
||||
|
||||
assert((mapbits & CHUNK_MAP_DECOMMITTED) == 0 || !unzeroed);
|
||||
arena_mapbitsp_write(mapbitsp, (mapbits & ~CHUNK_MAP_UNZEROED) |
|
||||
unzeroed);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void *chunk_alloc_cache(arena_t *arena, chunk_hooks_t *chunk_hooks,
|
|||
void *chunk_alloc_wrapper(arena_t *arena, chunk_hooks_t *chunk_hooks,
|
||||
void *new_addr, size_t size, size_t alignment, bool *zero, bool *commit);
|
||||
void chunk_dalloc_cache(arena_t *arena, chunk_hooks_t *chunk_hooks,
|
||||
void *chunk, size_t size);
|
||||
void *chunk, size_t size, bool committed);
|
||||
void chunk_dalloc_arena(arena_t *arena, chunk_hooks_t *chunk_hooks,
|
||||
void *chunk, size_t size, bool zeroed, bool committed);
|
||||
void chunk_dalloc_wrapper(arena_t *arena, chunk_hooks_t *chunk_hooks,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct extent_node_s {
|
|||
/*
|
||||
* True if physical memory is committed to the extent, whether
|
||||
* explicitly or implicitly as on a system that overcommits and
|
||||
* satisfies physical mamory needs on demand via soft page faults.
|
||||
* satisfies physical memory needs on demand via soft page faults.
|
||||
*/
|
||||
bool en_committed;
|
||||
|
||||
|
|
@ -125,6 +125,7 @@ JEMALLOC_INLINE bool
|
|||
extent_node_committed_get(const extent_node_t *node)
|
||||
{
|
||||
|
||||
assert(!extent_node_achunk_get(node));
|
||||
return (node->en_committed);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue