mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Add safety check on sdallocx slow / sampled path.
This commit is contained in:
parent
88d9eca848
commit
974222c626
4 changed files with 19 additions and 5 deletions
|
|
@ -2632,7 +2632,11 @@ isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache, bool slow_path) {
|
|||
rtree_szind_slab_read(tsd_tsdn(tsd), &extents_rtree,
|
||||
rtree_ctx, (uintptr_t)ptr, true, &ctx->szind,
|
||||
&ctx->slab);
|
||||
assert(ctx->szind == sz_size2index(usize));
|
||||
/* Small alloc may have !slab (sampled). */
|
||||
bool sz_correct = (ctx->szind == sz_size2index(usize));
|
||||
if (config_opt_safety_checks && !sz_correct) {
|
||||
safety_check_fail_sized_dealloc(true);
|
||||
}
|
||||
} else {
|
||||
ctx = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue