Home | History | Annotate | Download | only in src

Lines Matching refs:oldsize

133 huge_ralloc_no_move_similar(void *ptr, size_t oldsize, size_t usize,
143 while (usize < s2u(size+extra) && (usize_next = s2u(usize+1)) < oldsize)
146 if (oldsize == usize)
157 if (oldsize > usize) {
158 size_t sdiff = oldsize - usize;
176 arena_chunk_ralloc_huge_similar(arena, ptr, oldsize, usize);
179 if (oldsize < usize) {
182 memset((void *)((uintptr_t)ptr + oldsize), 0,
183 usize - oldsize);
186 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize -
187 oldsize);
193 huge_ralloc_no_move_shrink(void *ptr, size_t oldsize, size_t usize)
207 if (oldsize > usize) {
208 size_t sdiff = oldsize - usize;
228 arena_chunk_ralloc_huge_shrink(arena, ptr, oldsize, usize);
232 huge_ralloc_no_move_expand(void *ptr, size_t oldsize, size_t size, bool zero) {
256 if (arena_chunk_ralloc_huge_expand(arena, ptr, oldsize, usize,
267 memset((void *)((uintptr_t)ptr + oldsize), 0,
268 CHUNK_CEILING(oldsize) - oldsize);
272 CHUNK_CEILING(oldsize)), 0, usize -
273 CHUNK_CEILING(oldsize));
276 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize -
277 oldsize);
284 huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra,
290 if (oldsize < chunksize)
293 assert(s2u(oldsize) == oldsize);
304 if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize)
305 && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(size+extra)) {
306 huge_ralloc_no_move_similar(ptr, oldsize, usize, size, extra,
312 if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize)) {
313 huge_ralloc_no_move_shrink(ptr, oldsize, usize);
318 if (huge_ralloc_no_move_expand(ptr, oldsize, size + extra, zero)) {
323 return (huge_ralloc_no_move_expand(ptr, oldsize, size, zero));
329 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t size,
336 if (!huge_ralloc_no_move(ptr, oldsize, size, extra, zero))
340 * size and oldsize are different enough that we need to use a
368 copysize = (size < oldsize) ? size : oldsize;
370 isqalloc(tsd, ptr, oldsize, tcache);