mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
PA: have expand take sizes instead of new usize.
This avoids involving usize, which makes some of the stats modifications more intuitively correct.
This commit is contained in:
parent
5bcc2c2ab9
commit
74958567a4
3 changed files with 16 additions and 13 deletions
|
|
@ -106,7 +106,9 @@ large_ralloc_no_move_expand(tsdn_t *tsdn, edata_t *edata, size_t usize,
|
|||
zero = true;
|
||||
}
|
||||
|
||||
size_t old_size = edata_size_get(edata);
|
||||
size_t old_usize = edata_usize_get(edata);
|
||||
size_t new_size = usize + sz_large_pad;
|
||||
|
||||
/*
|
||||
* Copy zero into is_zeroed_trail and pass the copy when allocating the
|
||||
|
|
@ -116,7 +118,7 @@ large_ralloc_no_move_expand(tsdn_t *tsdn, edata_t *edata, size_t usize,
|
|||
bool is_zeroed_trail = zero;
|
||||
size_t mapped_add;
|
||||
szind_t szind = sz_size2index(usize);
|
||||
bool err = pa_expand(tsdn, &arena->pa_shard, edata, usize,
|
||||
bool err = pa_expand(tsdn, &arena->pa_shard, edata, old_size, new_size,
|
||||
szind, /* slab */ false, &is_zeroed_trail, &mapped_add);
|
||||
if (err) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue