mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
Fix pac_mapped stats inflation on allocation failure
newly_mapped_size was set unconditionally in the ecache_alloc_grow fallback path, even when the allocation returned NULL. This inflated pac_mapped stats without a corresponding deallocation to correct them. Guard the assignment with an edata != NULL check, matching the pattern used in the batched allocation path above it.
This commit is contained in:
parent
c2d57040f0
commit
3a8bee81f1
1 changed files with 3 additions and 1 deletions
|
|
@ -198,7 +198,9 @@ pac_alloc_real(tsdn_t *tsdn, pac_t *pac, ehooks_t *ehooks, size_t size,
|
|||
edata = ecache_alloc_grow(tsdn, pac, ehooks,
|
||||
&pac->ecache_retained, NULL, size, alignment, zero,
|
||||
guarded);
|
||||
newly_mapped_size = size;
|
||||
if (edata != NULL) {
|
||||
newly_mapped_size = size;
|
||||
}
|
||||
}
|
||||
|
||||
if (config_stats && newly_mapped_size != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue