Lines Matching refs:oldsize

874 arena_huge_ralloc_stats_update(arena_t *arena, size_t oldsize, size_t usize)  in arena_huge_ralloc_stats_update()  argument
877 arena_huge_dalloc_stats_update(arena, oldsize); in arena_huge_ralloc_stats_update()
882 arena_huge_ralloc_stats_update_undo(arena_t *arena, size_t oldsize, in arena_huge_ralloc_stats_update_undo() argument
886 arena_huge_dalloc_stats_update_undo(arena, oldsize); in arena_huge_ralloc_stats_update_undo()
990 size_t oldsize, size_t usize) in arena_chunk_ralloc_huge_similar() argument
993 assert(CHUNK_CEILING(oldsize) == CHUNK_CEILING(usize)); in arena_chunk_ralloc_huge_similar()
994 assert(oldsize != usize); in arena_chunk_ralloc_huge_similar()
998 arena_huge_ralloc_stats_update(arena, oldsize, usize); in arena_chunk_ralloc_huge_similar()
999 if (oldsize < usize) in arena_chunk_ralloc_huge_similar()
1000 arena_nactive_add(arena, (usize - oldsize) >> LG_PAGE); in arena_chunk_ralloc_huge_similar()
1002 arena_nactive_sub(arena, (oldsize - usize) >> LG_PAGE); in arena_chunk_ralloc_huge_similar()
1008 size_t oldsize, size_t usize, size_t sn) in arena_chunk_ralloc_huge_shrink() argument
1010 size_t udiff = oldsize - usize; in arena_chunk_ralloc_huge_shrink()
1011 size_t cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize); in arena_chunk_ralloc_huge_shrink()
1015 arena_huge_ralloc_stats_update(arena, oldsize, usize); in arena_chunk_ralloc_huge_shrink()
1034 chunk_hooks_t *chunk_hooks, void *chunk, size_t oldsize, size_t usize, in arena_chunk_ralloc_huge_expand_hard() argument
1046 arena_huge_ralloc_stats_update_undo(arena, oldsize, in arena_chunk_ralloc_huge_expand_hard()
1052 } else if (chunk_hooks->merge(chunk, CHUNK_CEILING(oldsize), nchunk, in arena_chunk_ralloc_huge_expand_hard()
1063 size_t oldsize, size_t usize, bool *zero) in arena_chunk_ralloc_huge_expand() argument
1067 void *nchunk = (void *)((uintptr_t)chunk + CHUNK_CEILING(oldsize)); in arena_chunk_ralloc_huge_expand()
1068 size_t udiff = usize - oldsize; in arena_chunk_ralloc_huge_expand()
1069 size_t cdiff = CHUNK_CEILING(usize) - CHUNK_CEILING(oldsize); in arena_chunk_ralloc_huge_expand()
1077 arena_huge_ralloc_stats_update(arena, oldsize, usize); in arena_chunk_ralloc_huge_expand()
1087 &chunk_hooks, chunk, oldsize, usize, &sn, zero, nchunk, in arena_chunk_ralloc_huge_expand()
1089 } else if (chunk_hooks.merge(chunk, CHUNK_CEILING(oldsize), nchunk, in arena_chunk_ralloc_huge_expand()
2197 arena_run_t *run, size_t oldsize, size_t newsize) in arena_run_trim_head() argument
2201 size_t head_npages = (oldsize - newsize) >> LG_PAGE; in arena_run_trim_head()
2207 assert(oldsize > newsize); in arena_run_trim_head()
2214 assert(arena_mapbits_large_size_get(chunk, pageind) == oldsize); in arena_run_trim_head()
2218 arena_mapbits_large_set(chunk, pageind, oldsize-newsize, flag_dirty | in arena_run_trim_head()
2238 arena_run_t *run, size_t oldsize, size_t newsize, bool dirty) in arena_run_trim_tail() argument
2250 assert(oldsize > newsize); in arena_run_trim_tail()
2257 assert(arena_mapbits_large_size_get(chunk, pageind) == oldsize); in arena_run_trim_tail()
2265 UNUSED size_t tail_npages = (oldsize - newsize) >> LG_PAGE; in arena_run_trim_tail()
2271 arena_mapbits_large_set(chunk, pageind+head_npages, oldsize-newsize, in arena_run_trim_tail()
3056 void *ptr, size_t oldsize, size_t size) in arena_ralloc_large_shrink() argument
3063 assert(size < oldsize); in arena_ralloc_large_shrink()
3070 arena_run_trim_tail(tsdn, arena, chunk, run, oldsize + large_pad, size + in arena_ralloc_large_shrink()
3073 szind_t oldindex = size2index(oldsize) - NBINS; in arena_ralloc_large_shrink()
3077 arena->stats.allocated_large -= oldsize; in arena_ralloc_large_shrink()
3093 void *ptr, size_t oldsize, size_t usize_min, size_t usize_max, bool zero) in arena_ralloc_large_grow() argument
3096 size_t npages = (oldsize + large_pad) >> LG_PAGE; in arena_ralloc_large_grow()
3099 assert(oldsize == arena_mapbits_large_size_get(chunk, pageind) - in arena_ralloc_large_grow()
3108 if (oldsize + followsize >= usize_min) { in arena_ralloc_large_grow()
3118 while (oldsize + followsize < usize) in arena_ralloc_large_grow()
3121 assert(usize >= oldsize); in arena_ralloc_large_grow()
3122 splitsize = usize - oldsize; in arena_ralloc_large_grow()
3138 void *zbase = (void *)((uintptr_t)ptr + oldsize); in arena_ralloc_large_grow()
3146 size = oldsize + splitsize; in arena_ralloc_large_grow()
3168 szind_t oldindex = size2index(oldsize) - NBINS; in arena_ralloc_large_grow()
3172 arena->stats.allocated_large -= oldsize; in arena_ralloc_large_grow()
3216 arena_ralloc_large(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t usize_min, in arena_ralloc_large() argument
3222 if (oldsize == usize_max) { in arena_ralloc_large()
3230 if (oldsize < usize_max) { in arena_ralloc_large()
3232 oldsize, usize_min, usize_max, zero); in arena_ralloc_large()
3235 memset((void *)((uintptr_t)ptr + oldsize), in arena_ralloc_large()
3237 isalloc(tsdn, ptr, config_prof) - oldsize); in arena_ralloc_large()
3239 memset((void *)((uintptr_t)ptr + oldsize), 0, in arena_ralloc_large()
3240 isalloc(tsdn, ptr, config_prof) - oldsize); in arena_ralloc_large()
3246 assert(oldsize > usize_max); in arena_ralloc_large()
3248 arena_ralloc_junk_large(ptr, oldsize, usize_max); in arena_ralloc_large()
3249 arena_ralloc_large_shrink(tsdn, arena, chunk, ptr, oldsize, usize_max); in arena_ralloc_large()
3254 arena_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, in arena_ralloc_no_move() argument
3267 if (likely(oldsize <= large_maxclass && usize_min <= large_maxclass)) { in arena_ralloc_no_move()
3274 if (oldsize <= SMALL_MAXCLASS) { in arena_ralloc_no_move()
3275 assert(arena_bin_info[size2index(oldsize)].reg_size == in arena_ralloc_no_move()
3276 oldsize); in arena_ralloc_no_move()
3278 size2index(usize_max) != size2index(oldsize)) && in arena_ralloc_no_move()
3279 (size > oldsize || usize_max < oldsize)) in arena_ralloc_no_move()
3284 if (arena_ralloc_large(tsdn, ptr, oldsize, usize_min, in arena_ralloc_no_move()
3293 return (huge_ralloc_no_move(tsdn, ptr, oldsize, usize_min, in arena_ralloc_no_move()
3313 arena_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t size, in arena_ralloc() argument
3327 if (!arena_ralloc_no_move(tsd_tsdn(tsd), ptr, oldsize, usize, 0, in arena_ralloc()
3346 copysize = (usize < oldsize) ? usize : oldsize; in arena_ralloc()
3349 isqalloc(tsd, ptr, oldsize, tcache, true); in arena_ralloc()
3351 ret = huge_ralloc(tsd, arena, ptr, oldsize, usize, alignment, in arena_ralloc()