Lines Matching refs:usize
34 huge_malloc(tsd_t *tsd, arena_t *arena, size_t usize, bool zero, in huge_malloc() argument
38 assert(usize == s2u(usize)); in huge_malloc()
40 return (huge_palloc(tsd, arena, usize, chunksize, zero, tcache)); in huge_malloc()
44 huge_palloc(tsd_t *tsd, arena_t *arena, size_t usize, size_t alignment, in huge_palloc() argument
54 ausize = sa2u(usize, alignment); in huge_palloc()
83 usize, alignment, &is_zeroed)) == NULL) { in huge_palloc()
88 extent_node_init(node, arena, ret, usize, is_zeroed, true); in huge_palloc()
91 arena_chunk_dalloc_huge(arena, ret, usize); in huge_palloc()
104 memset(ret, 0, usize); in huge_palloc()
106 memset(ret, 0xa5, usize); in huge_palloc()
117 huge_dalloc_junk(void *ptr, size_t usize) in huge_dalloc_junk() argument
126 memset(ptr, 0x5a, usize); in huge_dalloc_junk()
139 size_t usize, usize_next; in huge_ralloc_no_move_similar() local
146 for (usize = usize_min; usize < usize_max && (usize_next = s2u(usize+1)) in huge_ralloc_no_move_similar()
147 <= oldsize; usize = usize_next) in huge_ralloc_no_move_similar()
150 if (oldsize == usize) in huge_ralloc_no_move_similar()
158 if (oldsize > usize) { in huge_ralloc_no_move_similar()
159 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_similar()
161 memset((void *)((uintptr_t)ptr + usize), 0x5a, sdiff); in huge_ralloc_no_move_similar()
165 ptr, CHUNK_CEILING(oldsize), usize, sdiff); in huge_ralloc_no_move_similar()
172 assert(extent_node_size_get(node) != usize); in huge_ralloc_no_move_similar()
173 extent_node_size_set(node, usize); in huge_ralloc_no_move_similar()
178 arena_chunk_ralloc_huge_similar(arena, ptr, oldsize, usize); in huge_ralloc_no_move_similar()
181 if (oldsize < usize) { in huge_ralloc_no_move_similar()
185 usize - oldsize); in huge_ralloc_no_move_similar()
188 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize - in huge_ralloc_no_move_similar()
195 huge_ralloc_no_move_shrink(void *ptr, size_t oldsize, size_t usize) in huge_ralloc_no_move_shrink() argument
208 assert(oldsize > usize); in huge_ralloc_no_move_shrink()
211 cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize); in huge_ralloc_no_move_shrink()
213 CHUNK_CEILING(usize), cdiff, true, arena->ind)) in huge_ralloc_no_move_shrink()
216 if (oldsize > usize) { in huge_ralloc_no_move_shrink()
217 size_t sdiff = oldsize - usize; in huge_ralloc_no_move_shrink()
219 huge_dalloc_junk((void *)((uintptr_t)ptr + usize), in huge_ralloc_no_move_shrink()
224 CHUNK_ADDR2BASE((uintptr_t)ptr + usize), in huge_ralloc_no_move_shrink()
226 CHUNK_ADDR2OFFSET((uintptr_t)ptr + usize), sdiff); in huge_ralloc_no_move_shrink()
233 extent_node_size_set(node, usize); in huge_ralloc_no_move_shrink()
239 arena_chunk_ralloc_huge_shrink(arena, ptr, oldsize, usize); in huge_ralloc_no_move_shrink()
245 huge_ralloc_no_move_expand(void *ptr, size_t oldsize, size_t usize, bool zero) { in huge_ralloc_no_move_expand() argument
262 if (arena_chunk_ralloc_huge_expand(arena, ptr, oldsize, usize, in huge_ralloc_no_move_expand()
268 extent_node_size_set(node, usize); in huge_ralloc_no_move_expand()
278 CHUNK_CEILING(oldsize)), 0, usize - in huge_ralloc_no_move_expand()
282 memset((void *)((uintptr_t)ptr + oldsize), 0xa5, usize - in huge_ralloc_no_move_expand()
341 huge_ralloc_move_helper(tsd_t *tsd, arena_t *arena, size_t usize, in huge_ralloc_move_helper() argument
346 return (huge_malloc(tsd, arena, usize, zero, tcache)); in huge_ralloc_move_helper()
347 return (huge_palloc(tsd, arena, usize, alignment, zero, tcache)); in huge_ralloc_move_helper()
351 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t usize, in huge_ralloc() argument
358 assert(usize > 0 && usize <= HUGE_MAXCLASS); in huge_ralloc()
361 if (!huge_ralloc_no_move(tsd, ptr, oldsize, usize, usize, zero)) in huge_ralloc()
369 ret = huge_ralloc_move_helper(tsd, arena, usize, alignment, zero, in huge_ralloc()
374 copysize = (usize < oldsize) ? usize : oldsize; in huge_ralloc()