Home | History | Annotate | Download | only in src

Lines Matching refs:oldsize

136 huge_ralloc_no_move_similar(void *ptr, size_t oldsize, size_t usize_min,
147 <= oldsize; usize = usize_next)
150 if (oldsize == usize)
158 if (oldsize > usize) {
159 size_t sdiff = oldsize - usize;
165 ptr, CHUNK_CEILING(oldsize), usize, sdiff);
178 arena_chunk_ralloc_huge_similar(arena, ptr, oldsize, usize);
181 if (oldsize < usize) {
184 memset((void *)((uintptr_t)ptr + oldsize), 0,
185 usize - oldsize);
188 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize -
189 oldsize);
195 huge_ralloc_no_move_shrink(void *ptr, size_t oldsize, size_t usize)
208 assert(oldsize > usize);
211 cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize);
212 if (cdiff != 0 && chunk_hooks.split(ptr, CHUNK_CEILING(oldsize),
216 if (oldsize > usize) {
217 size_t sdiff = oldsize - usize;
225 CHUNK_CEILING(oldsize),
239 arena_chunk_ralloc_huge_shrink(arena, ptr, oldsize, usize);
245 huge_ralloc_no_move_expand(void *ptr, size_t oldsize, size_t usize, bool zero) {
262 if (arena_chunk_ralloc_huge_expand(arena, ptr, oldsize, usize,
273 memset((void *)((uintptr_t)ptr + oldsize), 0,
274 CHUNK_CEILING(oldsize) - oldsize);
278 CHUNK_CEILING(oldsize)), 0, usize -
279 CHUNK_CEILING(oldsize));
282 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize -
283 oldsize);
290 huge_ralloc_no_move(tsd_t *tsd, void *ptr, size_t oldsize, size_t usize_min,
294 assert(s2u(oldsize) == oldsize);
299 if (oldsize < chunksize || usize_max < chunksize)
302 if (CHUNK_CEILING(usize_max) > CHUNK_CEILING(oldsize)) {
304 if (!huge_ralloc_no_move_expand(ptr, oldsize, usize_max,
311 CHUNK_CEILING(oldsize) && huge_ralloc_no_move_expand(ptr,
312 oldsize, usize_min, zero)) {
322 if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize_min)
323 && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(usize_max)) {
324 huge_ralloc_no_move_similar(ptr, oldsize, usize_min, usize_max,
331 if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max)) {
332 if (!huge_ralloc_no_move_shrink(ptr, oldsize, usize_max)) {
351 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t usize,
361 if (!huge_ralloc_no_move(tsd, ptr, oldsize, usize, usize, zero))
365 * usize and oldsize are different enough that we need to use a
374 copysize = (usize < oldsize) ? usize : oldsize;
376 isqalloc(tsd, ptr, oldsize, tcache);