Lines Matching refs:oldsize

129 huge_ralloc_no_move_similar(void *ptr, size_t oldsize, size_t usize_min,  in huge_ralloc_no_move_similar()  argument
140 <= oldsize; usize = usize_next) in huge_ralloc_no_move_similar()
143 if (oldsize == usize) in huge_ralloc_no_move_similar()
151 if (oldsize > usize) { in huge_ralloc_no_move_similar()
152 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_similar()
158 ptr, CHUNK_CEILING(oldsize), usize, sdiff); in huge_ralloc_no_move_similar()
171 arena_chunk_ralloc_huge_similar(arena, ptr, oldsize, usize); in huge_ralloc_no_move_similar()
174 if (oldsize < usize) { in huge_ralloc_no_move_similar()
177 memset((void *)((uintptr_t)ptr + oldsize), 0, in huge_ralloc_no_move_similar()
178 usize - oldsize); in huge_ralloc_no_move_similar()
181 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize - in huge_ralloc_no_move_similar()
182 oldsize); in huge_ralloc_no_move_similar()
188 huge_ralloc_no_move_shrink(void *ptr, size_t oldsize, size_t usize) in huge_ralloc_no_move_shrink() argument
201 assert(oldsize > usize); in huge_ralloc_no_move_shrink()
204 cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize); in huge_ralloc_no_move_shrink()
205 if (cdiff != 0 && chunk_hooks.split(ptr, CHUNK_CEILING(oldsize), in huge_ralloc_no_move_shrink()
209 if (oldsize > usize) { in huge_ralloc_no_move_shrink()
210 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_shrink()
218 CHUNK_CEILING(oldsize), in huge_ralloc_no_move_shrink()
232 arena_chunk_ralloc_huge_shrink(arena, ptr, oldsize, usize); in huge_ralloc_no_move_shrink()
238 huge_ralloc_no_move_expand(void *ptr, size_t oldsize, size_t usize, bool zero) { in huge_ralloc_no_move_expand() argument
255 if (arena_chunk_ralloc_huge_expand(arena, ptr, oldsize, usize, in huge_ralloc_no_move_expand()
266 memset((void *)((uintptr_t)ptr + oldsize), 0, in huge_ralloc_no_move_expand()
267 CHUNK_CEILING(oldsize) - oldsize); in huge_ralloc_no_move_expand()
271 CHUNK_CEILING(oldsize)), 0, usize - in huge_ralloc_no_move_expand()
272 CHUNK_CEILING(oldsize)); in huge_ralloc_no_move_expand()
275 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize - in huge_ralloc_no_move_expand()
276 oldsize); in huge_ralloc_no_move_expand()
283 huge_ralloc_no_move(void *ptr, size_t oldsize, size_t usize_min, in huge_ralloc_no_move() argument
287 assert(s2u(oldsize) == oldsize); in huge_ralloc_no_move()
290 if (oldsize < chunksize || usize_max < chunksize) in huge_ralloc_no_move()
293 if (CHUNK_CEILING(usize_max) > CHUNK_CEILING(oldsize)) { in huge_ralloc_no_move()
295 if (!huge_ralloc_no_move_expand(ptr, oldsize, usize_max, zero)) in huge_ralloc_no_move()
299 CHUNK_CEILING(oldsize) && huge_ralloc_no_move_expand(ptr, in huge_ralloc_no_move()
300 oldsize, usize_min, zero)) in huge_ralloc_no_move()
308 if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize_min) in huge_ralloc_no_move()
309 && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(usize_max)) { in huge_ralloc_no_move()
310 huge_ralloc_no_move_similar(ptr, oldsize, usize_min, usize_max, in huge_ralloc_no_move()
316 if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max)) in huge_ralloc_no_move()
317 return (huge_ralloc_no_move_shrink(ptr, oldsize, usize_max)); in huge_ralloc_no_move()
332 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t usize, in huge_ralloc() argument
339 if (!huge_ralloc_no_move(ptr, oldsize, usize, usize, zero)) in huge_ralloc()
352 copysize = (usize < oldsize) ? usize : oldsize; in huge_ralloc()
354 isqalloc(tsd, ptr, oldsize, tcache); in huge_ralloc()