Deleted Added
full compact
34c34
< huge_malloc(tsd_t *tsd, arena_t *arena, size_t size, bool zero,
---
> huge_malloc(tsd_t *tsd, arena_t *arena, size_t usize, bool zero,
37d36
< size_t usize;
39,43c38
< usize = s2u(size);
< if (usize == 0) {
< /* size_t overflow. */
< return (NULL);
< }
---
> assert(usize == s2u(usize));
49c44
< huge_palloc(tsd_t *tsd, arena_t *arena, size_t size, size_t alignment,
---
> huge_palloc(tsd_t *tsd, arena_t *arena, size_t usize, size_t alignment,
53c48
< size_t usize;
---
> size_t ausize;
59,60c54,55
< usize = sa2u(size, alignment);
< if (unlikely(usize == 0))
---
> ausize = sa2u(usize, alignment);
> if (unlikely(ausize == 0 || ausize > HUGE_MAXCLASS))
62c57
< assert(usize >= chunksize);
---
> assert(ausize >= chunksize);
77,78c72,73
< size, alignment, &is_zeroed)) == NULL) {
< idalloctm(tsd, node, tcache, true);
---
> usize, alignment, &is_zeroed)) == NULL) {
> idalloctm(tsd, node, tcache, true, true);
82c77
< extent_node_init(node, arena, ret, size, is_zeroed, true);
---
> extent_node_init(node, arena, ret, usize, is_zeroed, true);
85,86c80,81
< arena_chunk_dalloc_huge(arena, ret, size);
< idalloctm(tsd, node, tcache, true);
---
> arena_chunk_dalloc_huge(arena, ret, usize);
> idalloctm(tsd, node, tcache, true, true);
98c93
< memset(ret, 0, size);
---
> memset(ret, 0, usize);
100c95
< memset(ret, 0xa5, size);
---
> memset(ret, 0xa5, usize);
101a97
> arena_decay_tick(tsd, arena);
283c279
< huge_ralloc_no_move(void *ptr, size_t oldsize, size_t usize_min,
---
> huge_ralloc_no_move(tsd_t *tsd, void *ptr, size_t oldsize, size_t usize_min,
287a284,285
> /* The following should have been caught by callers. */
> assert(usize_min > 0 && usize_max <= HUGE_MAXCLASS);
295c293,295
< if (!huge_ralloc_no_move_expand(ptr, oldsize, usize_max, zero))
---
> if (!huge_ralloc_no_move_expand(ptr, oldsize, usize_max,
> zero)) {
> arena_decay_tick(tsd, huge_aalloc(ptr));
296a297
> }
300c301,302
< oldsize, usize_min, zero))
---
> oldsize, usize_min, zero)) {
> arena_decay_tick(tsd, huge_aalloc(ptr));
301a304
> }
311a315
> arena_decay_tick(tsd, huge_aalloc(ptr));
316,317c320,325
< if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max))
< return (huge_ralloc_no_move_shrink(ptr, oldsize, usize_max));
---
> if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max)) {
> if (!huge_ralloc_no_move_shrink(ptr, oldsize, usize_max)) {
> arena_decay_tick(tsd, huge_aalloc(ptr));
> return (false);
> }
> }
337a346,348
> /* The following should have been caught by callers. */
> assert(usize > 0 && usize <= HUGE_MAXCLASS);
>
339c350
< if (!huge_ralloc_no_move(ptr, oldsize, usize, usize, zero))
---
> if (!huge_ralloc_no_move(tsd, ptr, oldsize, usize, usize, zero))
375c386,388
< idalloctm(tsd, node, tcache, true);
---
> idalloctm(tsd, node, tcache, true, true);
>
> arena_decay_tick(tsd, arena);