Lines Matching refs:oldsize
152 huge_ralloc_no_move_similar(tsdn_t *tsdn, void *ptr, size_t oldsize, in huge_ralloc_no_move_similar() argument
163 <= oldsize; usize = usize_next) in huge_ralloc_no_move_similar()
166 if (oldsize == usize) in huge_ralloc_no_move_similar()
174 if (oldsize > usize) { in huge_ralloc_no_move_similar()
175 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_similar()
182 &chunk_hooks, ptr, CHUNK_CEILING(oldsize), usize, in huge_ralloc_no_move_similar()
198 arena_chunk_ralloc_huge_similar(tsdn, arena, ptr, oldsize, usize); in huge_ralloc_no_move_similar()
201 if (oldsize < usize) { in huge_ralloc_no_move_similar()
204 memset((void *)((uintptr_t)ptr + oldsize), 0, in huge_ralloc_no_move_similar()
205 usize - oldsize); in huge_ralloc_no_move_similar()
208 memset((void *)((uintptr_t)ptr + oldsize), in huge_ralloc_no_move_similar()
209 JEMALLOC_ALLOC_JUNK, usize - oldsize); in huge_ralloc_no_move_similar()
215 huge_ralloc_no_move_shrink(tsdn_t *tsdn, void *ptr, size_t oldsize, in huge_ralloc_no_move_shrink() argument
229 assert(oldsize > usize); in huge_ralloc_no_move_shrink()
232 cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize); in huge_ralloc_no_move_shrink()
233 if (cdiff != 0 && chunk_hooks.split(ptr, CHUNK_CEILING(oldsize), in huge_ralloc_no_move_shrink()
237 if (oldsize > usize) { in huge_ralloc_no_move_shrink()
238 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_shrink()
246 usize), CHUNK_CEILING(oldsize), in huge_ralloc_no_move_shrink()
262 arena_chunk_ralloc_huge_shrink(tsdn, arena, ptr, oldsize, usize, in huge_ralloc_no_move_shrink()
269 huge_ralloc_no_move_expand(tsdn_t *tsdn, void *ptr, size_t oldsize, in huge_ralloc_no_move_expand() argument
286 if (arena_chunk_ralloc_huge_expand(tsdn, arena, ptr, oldsize, usize, in huge_ralloc_no_move_expand()
300 memset((void *)((uintptr_t)ptr + oldsize), 0, in huge_ralloc_no_move_expand()
301 CHUNK_CEILING(oldsize) - oldsize); in huge_ralloc_no_move_expand()
305 CHUNK_CEILING(oldsize)), 0, usize - in huge_ralloc_no_move_expand()
306 CHUNK_CEILING(oldsize)); in huge_ralloc_no_move_expand()
309 memset((void *)((uintptr_t)ptr + oldsize), JEMALLOC_ALLOC_JUNK, in huge_ralloc_no_move_expand()
310 usize - oldsize); in huge_ralloc_no_move_expand()
317 huge_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t usize_min, in huge_ralloc_no_move() argument
321 assert(s2u(oldsize) == oldsize); in huge_ralloc_no_move()
326 if (oldsize < chunksize || usize_max < chunksize) in huge_ralloc_no_move()
329 if (CHUNK_CEILING(usize_max) > CHUNK_CEILING(oldsize)) { in huge_ralloc_no_move()
331 if (!huge_ralloc_no_move_expand(tsdn, ptr, oldsize, usize_max, in huge_ralloc_no_move()
338 CHUNK_CEILING(oldsize) && huge_ralloc_no_move_expand(tsdn, in huge_ralloc_no_move()
339 ptr, oldsize, usize_min, zero)) { in huge_ralloc_no_move()
349 if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize_min) in huge_ralloc_no_move()
350 && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(usize_max)) { in huge_ralloc_no_move()
351 huge_ralloc_no_move_similar(tsdn, ptr, oldsize, usize_min, in huge_ralloc_no_move()
358 if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max)) { in huge_ralloc_no_move()
359 if (!huge_ralloc_no_move_shrink(tsdn, ptr, oldsize, in huge_ralloc_no_move()
379 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, in huge_ralloc() argument
389 if (!huge_ralloc_no_move(tsd_tsdn(tsd), ptr, oldsize, usize, usize, in huge_ralloc()
403 copysize = (usize < oldsize) ? usize : oldsize; in huge_ralloc()
405 isqalloc(tsd, ptr, oldsize, tcache, true); in huge_ralloc()