Home | History | Annotate | Download | only in src

Lines Matching full:usize

1419 imalloc_prof_sample(tsd_t *tsd, size_t usize, szind_t ind,
1426 if (usize <= SMALL_MAXCLASS) {
1431 arena_prof_promoted(p, usize);
1433 p = imalloc(tsd, usize, ind, slow_path);
1439 imalloc_prof(tsd_t *tsd, size_t usize, szind_t ind, bool slow_path)
1444 tctx = prof_alloc_prep(tsd, usize, prof_active_get_unlocked(), true);
1446 p = imalloc_prof_sample(tsd, usize, ind, tctx, slow_path);
1448 p = imalloc(tsd, usize, ind, slow_path);
1453 prof_malloc(p, usize, tctx);
1459 imalloc_body(size_t size, tsd_t **tsd, size_t *usize, bool slow_path)
1472 *usize = index2size(ind);
1473 assert(*usize > 0 && *usize <= HUGE_MAXCLASS);
1477 return (imalloc_prof(*tsd, *usize, ind, slow_path));
1483 imalloc_post_check(void *ret, tsd_t *tsd, size_t usize, bool slow_path)
1494 assert(usize == isalloc(ret, config_prof));
1495 *tsd_thread_allocatedp_get(tsd) += usize;
1506 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1516 ret = imalloc_body(size, &tsd, &usize, false);
1517 imalloc_post_check(ret, tsd, usize, false);
1519 ret = imalloc_body(size, &tsd, &usize, true);
1520 imalloc_post_check(ret, tsd, usize, true);
1522 JEMALLOC_VALGRIND_MALLOC(ret != NULL, ret, usize, false);
1529 imemalign_prof_sample(tsd_t *tsd, size_t alignment, size_t usize,
1536 if (usize <= SMALL_MAXCLASS) {
1541 arena_prof_promoted(p, usize);
1543 p = ipalloc(tsd, usize, alignment, false);
1549 imemalign_prof(tsd_t *tsd, size_t alignment, size_t usize)
1554 tctx = prof_alloc_prep(tsd, usize, prof_active_get_unlocked(), true);
1556 p = imemalign_prof_sample(tsd, alignment, usize, tctx);
1558 p = ipalloc(tsd, usize, alignment, false);
1563 prof_malloc(p, usize, tctx);
1574 size_t usize;
1600 usize = sa2u(size, alignment);
1601 if (unlikely(usize == 0 || usize > HUGE_MAXCLASS)) {
1607 result = imemalign_prof(tsd, alignment, usize);
1609 result = ipalloc(tsd, usize, alignment, false);
1618 assert(usize == isalloc(result, config_prof));
1619 *tsd_thread_allocatedp_get(tsd) += usize;
1662 icalloc_prof_sample(tsd_t *tsd, size_t usize, szind_t ind, prof_tctx_t *tctx)
1668 if (usize <= SMALL_MAXCLASS) {
1673 arena_prof_promoted(p, usize);
1675 p = icalloc(tsd, usize, ind);
1681 icalloc_prof(tsd_t *tsd, size_t usize, szind_t ind)
1686 tctx = prof_alloc_prep(tsd, usize, prof_active_get_unlocked(), true);
1688 p = icalloc_prof_sample(tsd, usize, ind, tctx);
1690 p = icalloc(tsd, usize, ind);
1695 prof_malloc(p, usize, tctx);
1709 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1744 usize = index2size(ind);
1745 ret = icalloc_prof(tsd, usize, ind);
1748 usize = index2size(ind);
1762 assert(usize == isalloc(ret, config_prof));
1763 *tsd_thread_allocatedp_get(tsd) += usize;
1766 JEMALLOC_VALGRIND_MALLOC(ret != NULL, ret, usize, true);
1771 irealloc_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
1778 if (usize <= SMALL_MAXCLASS) {
1782 arena_prof_promoted(p, usize);
1784 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
1790 irealloc_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize)
1798 tctx = prof_alloc_prep(tsd, usize, prof_active, true);
1800 p = irealloc_prof_sample(tsd, old_ptr, old_usize, usize, tctx);
1802 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
1807 prof_realloc(tsd, p, usize, tctx, prof_active, true, old_ptr, old_usize,
1816 size_t usize;
1823 usize = isalloc(ptr, config_prof);
1824 prof_free(tsd, ptr, usize);
1826 usize = isalloc(ptr, config_prof);
1828 *tsd_thread_deallocatedp_get(tsd) += usize;
1841 isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache)
1849 prof_free(tsd, ptr, usize);
1851 *tsd_thread_deallocatedp_get(tsd) += usize;
1854 isqalloc(tsd, ptr, usize, tcache);
1865 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1890 usize = s2u(size);
1891 ret = unlikely(usize == 0 || usize > HUGE_MAXCLASS) ?
1892 NULL : irealloc_prof(tsd, ptr, old_usize, usize);
1896 usize = s2u(size);
1902 ret = imalloc_body(size, &tsd, &usize, false);
1904 ret = imalloc_body(size, &tsd, &usize, true);
1916 assert(usize == isalloc(ret, config_prof));
1917 *tsd_thread_allocatedp_get(tsd) += usize;
1921 JEMALLOC_VALGRIND_REALLOC(true, ret, usize, true, ptr, old_usize,
2012 imallocx_flags_decode_hard(tsd_t *tsd, size_t size, int flags, size_t *usize,
2018 *usize = s2u(size);
2021 *usize = sa2u(size, *alignment);
2023 if (unlikely(*usize == 0 || *usize > HUGE_MAXCLASS))
2044 imallocx_flags_decode(tsd_t *tsd, size_t size, int flags, size_t *usize,
2049 *usize = s2u(size);
2050 if (unlikely(*usize == 0 || *usize > HUGE_MAXCLASS))
2058 return (imallocx_flags_decode_hard(tsd, size, flags, usize,
2064 imallocx_flags(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
2070 return (ipalloct(tsd, usize, alignment, zero, tcache, arena));
2071 ind = size2index(usize);
2074 return (icalloct(tsd, usize, ind, tcache, arena));
2075 return (imalloct(tsd, usize, ind, tcache, arena));
2079 imallocx_prof_sample(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
2084 if (usize <= SMALL_MAXCLASS) {
2091 arena_prof_promoted(p, usize);
2093 p = imallocx_flags(tsd, usize, alignment, zero, tcache, arena);
2099 imallocx_prof(tsd_t *tsd, size_t size, int flags, size_t *usize)
2108 if (unlikely(imallocx_flags_decode(tsd, size, flags, usize, &alignment,
2111 tctx = prof_alloc_prep(tsd, *usize, prof_active_get_unlocked(), true);
2113 p = imallocx_flags(tsd, *usize, alignment, zero, tcache, arena);
2115 p = imallocx_prof_sample(tsd, *usize, alignment, zero, tcache,
2123 prof_malloc(p, *usize, tctx);
2130 imallocx_no_prof(tsd_t *tsd, size_t size, int flags, size_t *usize)
2144 *usize = index2size(ind);
2145 assert(*usize > 0 && *usize <= HUGE_MAXCLASS);
2150 if (unlikely(imallocx_flags_decode_hard(tsd, size, flags, usize,
2153 p = imallocx_flags(tsd, *usize, alignment, zero, tcache, arena);
2165 size_t usize;
2174 p = imallocx_prof(tsd, size, flags, &usize);
2176 p = imallocx_no_prof(tsd, size, flags, &usize);
2181 assert(usize == isalloc(p, config_prof));
2182 *tsd_thread_allocatedp_get(tsd) += usize;
2185 JEMALLOC_VALGRIND_MALLOC(true, p, usize, MALLOCX_ZERO_GET(flags));
2198 size_t usize, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena,
2205 if (usize <= SMALL_MAXCLASS) {
2210 arena_prof_promoted(p, usize);
2212 p = iralloct(tsd, old_ptr, old_usize, usize, alignment, zero,
2221 size_t alignment, size_t *usize, bool zero, tcache_t *tcache,
2230 tctx = prof_alloc_prep(tsd, *usize, prof_active, true);
2232 p = irallocx_prof_sample(tsd, old_ptr, old_usize, *usize,
2249 * be the same as the current usize because of in-place large
2250 * reallocation. Therefore, query the actual value of usize.
2252 *usize = isalloc(p, config_prof);
2254 prof_realloc(tsd, p, *usize, tctx, prof_active, true, old_ptr,
2267 size_t usize;
2302 usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment);
2303 if (unlikely(usize == 0 || usize > HUGE_MAXCLASS))
2305 p = irallocx_prof(tsd, ptr, old_usize, size, alignment, &usize,
2315 usize = isalloc(p, config_prof);
2320 *tsd_thread_allocatedp_get(tsd) += usize;
2324 JEMALLOC_VALGRIND_REALLOC(true, p, usize, false, ptr, old_usize,
2340 size_t usize;
2344 usize = isalloc(ptr, config_prof);
2346 return (usize);
2353 size_t usize;
2357 usize = ixallocx_helper(tsd, ptr, old_usize, size, extra, alignment,
2360 return (usize);
2367 size_t usize_max, usize;
2374 * usize isn't knowable before ixalloc() returns when extra is non-zero.
2377 * prof_realloc() will use the actual usize to decide whether to sample.
2397 usize = ixallocx_prof_sample(tsd, ptr, old_usize, size, extra,
2400 usize = ixallocx_helper(tsd, ptr, old_usize, size, extra,
2403 if (usize == old_usize) {
2405 return (usize);
2407 prof_realloc(tsd, ptr, usize, tctx, prof_active, false, ptr, old_usize,
2410 return (usize);
2417 size_t usize, old_usize;
2441 usize = old_usize;
2451 usize = ixallocx_prof(tsd, ptr, old_usize, size, extra,
2454 usize = ixallocx_helper(tsd, ptr, old_usize, size, extra,
2457 if (unlikely(usize == old_usize))
2461 *tsd_thread_allocatedp_get(tsd) += usize;
2464 JEMALLOC_VALGRIND_REALLOC(false, ptr, usize, false, ptr, old_usize,
2468 return (usize);
2475 size_t usize;
2481 usize = ivsalloc(ptr, config_prof);
2483 usize = isalloc(ptr, config_prof);
2485 return (usize);
2513 size_t usize;
2516 usize = s2u(size);
2518 usize = sa2u(size, MALLOCX_ALIGN_GET_SPECIFIED(flags));
2519 return (usize);
2527 size_t usize;
2531 usize = inallocx(size, flags);
2532 assert(usize == isalloc(ptr, config_prof));
2544 isfree(tsd, ptr, usize, tcache);
2551 size_t usize;
2558 usize = inallocx(size, flags);
2559 if (unlikely(usize > HUGE_MAXCLASS))
2562 return (usize);