Lines Matching defs:usize
811 arena_huge_malloc_stats_update(arena_t *arena, size_t usize)
813 szind_t index = size2index(usize) - nlclasses - NBINS;
818 arena->stats.allocated_huge += usize;
824 arena_huge_malloc_stats_update_undo(arena_t *arena, size_t usize)
826 szind_t index = size2index(usize) - nlclasses - NBINS;
831 arena->stats.allocated_huge -= usize;
837 arena_huge_dalloc_stats_update(arena_t *arena, size_t usize)
839 szind_t index = size2index(usize) - nlclasses - NBINS;
844 arena->stats.allocated_huge -= usize;
850 arena_huge_reset_stats_cancel(arena_t *arena, size_t usize)
852 szind_t index = size2index(usize) - nlclasses - NBINS;
861 arena_huge_dalloc_stats_update_undo(arena_t *arena, size_t usize)
863 szind_t index = size2index(usize) - nlclasses - NBINS;
868 arena->stats.allocated_huge += usize;
874 arena_huge_ralloc_stats_update(arena_t *arena, size_t oldsize, size_t usize)
878 arena_huge_malloc_stats_update(arena, usize);
883 size_t usize)
887 arena_huge_malloc_stats_update_undo(arena, usize);
918 chunk_hooks_t *chunk_hooks, size_t usize, size_t alignment, size_t *sn,
930 arena_huge_malloc_stats_update_undo(arena, usize);
931 arena->stats.mapped -= usize;
933 arena_nactive_sub(arena, usize >> LG_PAGE);
941 arena_chunk_alloc_huge(tsdn_t *tsdn, arena_t *arena, size_t usize,
946 size_t csize = CHUNK_CEILING(usize);
953 arena_huge_malloc_stats_update(arena, usize);
954 arena->stats.mapped += usize;
956 arena_nactive_add(arena, usize >> LG_PAGE);
963 usize, alignment, sn, zero, csize);
970 arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk, size_t usize,
976 csize = CHUNK_CEILING(usize);
979 arena_huge_dalloc_stats_update(arena, usize);
980 arena->stats.mapped -= usize;
982 arena_nactive_sub(arena, usize >> LG_PAGE);
990 size_t oldsize, size_t usize)
993 assert(CHUNK_CEILING(oldsize) == CHUNK_CEILING(usize));
994 assert(oldsize != usize);
998 arena_huge_ralloc_stats_update(arena, oldsize, usize);
999 if (oldsize < usize)
1000 arena_nactive_add(arena, (usize - oldsize) >> LG_PAGE);
1002 arena_nactive_sub(arena, (oldsize - usize) >> LG_PAGE);
1008 size_t oldsize, size_t usize, size_t sn)
1010 size_t udiff = oldsize - usize;
1011 size_t cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize);
1015 arena_huge_ralloc_stats_update(arena, oldsize, usize);
1024 CHUNK_CEILING(usize));
1034 chunk_hooks_t *chunk_hooks, void *chunk, size_t oldsize, size_t usize,
1047 usize);
1063 size_t oldsize, size_t usize, bool *zero)
1068 size_t udiff = usize - oldsize;
1069 size_t cdiff = CHUNK_CEILING(usize) - CHUNK_CEILING(oldsize);
1077 arena_huge_ralloc_stats_update(arena, oldsize, usize);
1087 &chunk_hooks, chunk, oldsize, usize, &sn, zero, nchunk,
1879 size_t usize = isalloc(tsd_tsdn(tsd), ptr,
1882 prof_free(tsd, ptr, usize);
1941 size_t usize;
1945 usize = isalloc(tsd_tsdn(tsd), ptr, config_prof);
1948 prof_free(tsd, ptr, usize);
1953 arena_huge_reset_stats_cancel(arena, usize);
2478 arena_redzone_corruption(void *ptr, size_t usize, bool after,
2484 after ? "after" : "before", ptr, usize, byte);
2550 arena_quarantine_junk_small(void *ptr, size_t usize)
2557 assert(usize <= SMALL_MAXCLASS);
2559 binind = size2index(usize);
2569 size_t usize;
2574 usize = index2size(binind);
2593 if (config_prof && !isthreaded && arena_prof_accum(tsdn, arena, usize))
2602 memset(ret, 0, usize);
2604 JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, usize);
2610 JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, usize);
2611 memset(ret, 0, usize);
2622 size_t usize;
2629 usize = index2size(binind);
2644 run = arena_run_alloc_large(tsdn, arena, usize + large_pad, zero);
2657 arena->stats.allocated_large += usize;
2663 idump = arena_prof_accum_locked(arena, usize);
2671 memset(ret, JEMALLOC_ALLOC_JUNK, usize);
2673 memset(ret, 0, usize);
2702 arena_palloc_large(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
2713 assert(usize == PAGE_CEILING(usize));
2721 alloc_size = usize + large_pad + alignment - PAGE;
2735 assert(alloc_size >= leadsize + usize);
2736 trailsize = alloc_size - leadsize - usize - large_pad;
2750 arena_run_trim_tail(tsdn, arena, chunk, run, usize + large_pad +
2751 trailsize, usize + large_pad, false);
2753 if (arena_run_init_large(arena, run, usize + large_pad, zero)) {
2768 szind_t index = size2index(usize) - NBINS;
2772 arena->stats.allocated_large += usize;
2781 memset(ret, JEMALLOC_ALLOC_JUNK, usize);
2783 memset(ret, 0, usize);
2790 arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
2795 if (usize <= SMALL_MAXCLASS && (alignment < PAGE || (alignment == PAGE
2796 && (usize & PAGE_MASK) == 0))) {
2798 ret = arena_malloc(tsdn, arena, usize, size2index(usize), zero,
2800 } else if (usize <= large_maxclass && alignment <= PAGE) {
2807 ret = arena_malloc(tsdn, arena, usize, size2index(usize), zero,
2812 if (likely(usize <= large_maxclass)) {
2813 ret = arena_palloc_large(tsdn, arena, usize, alignment,
2816 ret = huge_malloc(tsdn, arena, usize, zero);
2818 ret = huge_palloc(tsdn, arena, usize, alignment, zero);
2994 arena_dalloc_junk_large(void *ptr, size_t usize)
2998 memset(ptr, JEMALLOC_FREE_JUNK, usize);
3017 size_t usize = arena_mapbits_large_size_get(chunk, pageind) -
3021 arena_dalloc_junk_large(ptr, usize);
3023 szind_t index = size2index(usize) - NBINS;
3026 arena->stats.allocated_large -= usize;
3115 size_t usize, splitsize, size, flag_dirty, flag_unzeroed_mask;
3117 usize = usize_max;
3118 while (oldsize + followsize < usize)
3119 usize = index2size(size2index(usize)-1);
3120 assert(usize >= usize_min);
3121 assert(usize >= oldsize);
3122 splitsize = usize - oldsize;
3196 arena_ralloc_junk_large(void *ptr, size_t old_usize, size_t usize)
3200 memset((void *)((uintptr_t)ptr + usize), JEMALLOC_FREE_JUNK,
3201 old_usize - usize);
3299 arena_ralloc_move_helper(tsdn_t *tsdn, arena_t *arena, size_t usize,
3304 return (arena_malloc(tsdn, arena, usize, size2index(usize),
3306 usize = sa2u(usize, alignment);
3307 if (unlikely(usize == 0 || usize > HUGE_MAXCLASS))
3309 return (ipalloct(tsdn, usize, alignment, zero, tcache, arena));
3317 size_t usize;
3319 usize = s2u(size);
3320 if (unlikely(usize == 0 || size > HUGE_MAXCLASS))
3323 if (likely(usize <= large_maxclass)) {
3327 if (!arena_ralloc_no_move(tsd_tsdn(tsd), ptr, oldsize, usize, 0,
3336 ret = arena_ralloc_move_helper(tsd_tsdn(tsd), arena, usize,
3346 copysize = (usize < oldsize) ? usize : oldsize;
3351 ret = huge_ralloc(tsd, arena, ptr, oldsize, usize, alignment,