Home | History | Annotate | Download | only in src

Lines Matching defs:usize

1537 ialloc_prof_sample(tsd_t *tsd, size_t usize, szind_t ind, bool zero,
1544 if (usize <= SMALL_MAXCLASS) {
1549 arena_prof_promoted(tsd_tsdn(tsd), p, usize);
1551 p = ialloc(tsd, usize, ind, zero, slow_path);
1557 ialloc_prof(tsd_t *tsd, size_t usize, szind_t ind, bool zero, bool slow_path)
1562 tctx = prof_alloc_prep(tsd, usize, prof_active_get_unlocked(), true);
1564 p = ialloc_prof_sample(tsd, usize, ind, zero, tctx, slow_path);
1566 p = ialloc(tsd, usize, ind, zero, slow_path);
1571 prof_malloc(tsd_tsdn(tsd), p, usize, tctx);
1583 ialloc_body(size_t size, bool zero, tsdn_t **tsdn, size_t *usize,
1604 *usize = index2size(ind);
1605 assert(*usize > 0 && *usize <= HUGE_MAXCLASS);
1609 return (ialloc_prof(tsd, *usize, ind, zero, slow_path));
1615 ialloc_post_check(void *ret, tsdn_t *tsdn, size_t usize, const char *func,
1631 assert(usize == isalloc(tsdn, ret, config_prof));
1632 *tsd_thread_allocatedp_get(tsdn_tsd(tsdn)) += usize;
1644 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1650 ret = ialloc_body(size, false, &tsdn, &usize, false);
1651 ialloc_post_check(ret, tsdn, usize, "malloc", true, false);
1653 ret = ialloc_body(size, false, &tsdn, &usize, true);
1654 ialloc_post_check(ret, tsdn, usize, "malloc", true, true);
1656 JEMALLOC_VALGRIND_MALLOC(ret != NULL, tsdn, ret, usize, false);
1663 imemalign_prof_sample(tsd_t *tsd, size_t alignment, size_t usize,
1670 if (usize <= SMALL_MAXCLASS) {
1675 arena_prof_promoted(tsd_tsdn(tsd), p, usize);
1677 p = ipalloc(tsd, usize, alignment, false);
1683 imemalign_prof(tsd_t *tsd, size_t alignment, size_t usize)
1688 tctx = prof_alloc_prep(tsd, usize, prof_active_get_unlocked(), true);
1690 p = imemalign_prof_sample(tsd, alignment, usize, tctx);
1692 p = ipalloc(tsd, usize, alignment, false);
1697 prof_malloc(tsd_tsdn(tsd), p, usize, tctx);
1708 size_t usize;
1736 usize = sa2u(size, alignment);
1737 if (unlikely(usize == 0 || usize > HUGE_MAXCLASS)) {
1743 result = imemalign_prof(tsd, alignment, usize);
1745 result = ipalloc(tsd, usize, alignment, false);
1754 assert(usize == isalloc(tsd_tsdn(tsd), result, config_prof));
1755 *tsd_thread_allocatedp_get(tsd) += usize;
1758 JEMALLOC_VALGRIND_MALLOC(result != NULL, tsd_tsdn(tsd), result, usize,
1809 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1827 ret = ialloc_body(num_size, true, &tsdn, &usize, false);
1828 ialloc_post_check(ret, tsdn, usize, "calloc", true, false);
1830 ret = ialloc_body(num_size, true, &tsdn, &usize, true);
1831 ialloc_post_check(ret, tsdn, usize, "calloc", true, true);
1833 JEMALLOC_VALGRIND_MALLOC(ret != NULL, tsdn, ret, usize, true);
1840 irealloc_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
1847 if (usize <= SMALL_MAXCLASS) {
1851 arena_prof_promoted(tsd_tsdn(tsd), p, usize);
1853 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
1859 irealloc_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize)
1867 tctx = prof_alloc_prep(tsd, usize, prof_active, true);
1869 p = irealloc_prof_sample(tsd, old_ptr, old_usize, usize, tctx);
1871 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
1876 prof_realloc(tsd, p, usize, tctx, prof_active, true, old_ptr, old_usize,
1885 size_t usize;
1894 usize = isalloc(tsd_tsdn(tsd), ptr, config_prof);
1895 prof_free(tsd, ptr, usize);
1897 usize = isalloc(tsd_tsdn(tsd), ptr, config_prof);
1899 *tsd_thread_deallocatedp_get(tsd) += usize;
1912 isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache, bool slow_path)
1922 prof_free(tsd, ptr, usize);
1924 *tsd_thread_deallocatedp_get(tsd) += usize;
1927 isqalloc(tsd, ptr, usize, tcache, slow_path);
1938 size_t usize JEMALLOC_CC_SILENCE_INIT(0);
1971 usize = s2u(size);
1972 ret = unlikely(usize == 0 || usize > HUGE_MAXCLASS) ?
1973 NULL : irealloc_prof(tsd, ptr, old_usize, usize);
1977 usize = s2u(size);
1984 ret = ialloc_body(size, false, &tsdn, &usize, false);
1986 ret = ialloc_body(size, false, &tsdn, &usize, true);
2001 assert(usize == isalloc(tsdn, ret, config_prof));
2003 *tsd_thread_allocatedp_get(tsd) += usize;
2007 JEMALLOC_VALGRIND_REALLOC(maybe, tsdn, ret, usize, maybe, ptr,
2122 imallocx_flags_decode(tsd_t *tsd, size_t size, int flags, size_t *usize,
2128 *usize = s2u(size);
2131 *usize = sa2u(size, *alignment);
2133 if (unlikely(*usize == 0 || *usize > HUGE_MAXCLASS))
2154 imallocx_flags(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
2160 return (ipalloct(tsdn, usize, alignment, zero, tcache, arena));
2161 ind = size2index(usize);
2163 return (iallocztm(tsdn, usize, ind, zero, tcache, false, arena,
2168 imallocx_prof_sample(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
2173 if (usize <= SMALL_MAXCLASS) {
2180 arena_prof_promoted(tsdn, p, usize);
2182 p = imallocx_flags(tsdn, usize, alignment, zero, tcache, arena,
2190 imallocx_prof(tsd_t *tsd, size_t size, int flags, size_t *usize, bool slow_path)
2199 if (unlikely(imallocx_flags_decode(tsd, size, flags, usize, &alignment,
2202 tctx = prof_alloc_prep(tsd, *usize, prof_active_get_unlocked(), true);
2204 p = imallocx_flags(tsd_tsdn(tsd), *usize, alignment, zero,
2207 p = imallocx_prof_sample(tsd_tsdn(tsd), *usize, alignment, zero,
2215 prof_malloc(tsd_tsdn(tsd), p, *usize, tctx);
2222 imallocx_no_prof(tsd_t *tsd, size_t size, int flags, size_t *usize,
2231 if (unlikely(imallocx_flags_decode(tsd, size, flags, usize, &alignment,
2234 p = imallocx_flags(tsd_tsdn(tsd), *usize, alignment, zero, tcache,
2242 imallocx_body(size_t size, int flags, tsdn_t **tsdn, size_t *usize,
2262 *usize = index2size(ind);
2263 assert(*usize > 0 && *usize <= HUGE_MAXCLASS);
2267 return (ialloc_prof(tsd, *usize, ind, false,
2275 return (imallocx_prof(tsd, size, flags, usize, slow_path));
2277 return (imallocx_no_prof(tsd, size, flags, usize, slow_path));
2287 size_t usize;
2292 p = imallocx_body(size, flags, &tsdn, &usize, false);
2293 ialloc_post_check(p, tsdn, usize, "mallocx", false, false);
2295 p = imallocx_body(size, flags, &tsdn, &usize, true);
2296 ialloc_post_check(p, tsdn, usize, "mallocx", false, true);
2298 JEMALLOC_VALGRIND_MALLOC(p != NULL, tsdn, p, usize,
2307 size_t usize, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena,
2314 if (usize <= SMALL_MAXCLASS) {
2319 arena_prof_promoted(tsd_tsdn(tsd), p, usize);
2321 p = iralloct(tsd, old_ptr, old_usize, usize, alignment, zero,
2330 size_t alignment, size_t *usize, bool zero, tcache_t *tcache,
2339 tctx = prof_alloc_prep(tsd, *usize, prof_active, false);
2341 p = irallocx_prof_sample(tsd, old_ptr, old_usize, *usize,
2358 * be the same as the current usize because of in-place large
2359 * reallocation. Therefore, query the actual value of usize.
2361 *usize = isalloc(tsd_tsdn(tsd), p, config_prof);
2363 prof_realloc(tsd, p, *usize, tctx, prof_active, false, old_ptr,
2376 size_t usize;
2412 usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment);
2413 if (unlikely(usize == 0 || usize > HUGE_MAXCLASS))
2415 p = irallocx_prof(tsd, ptr, old_usize, size, alignment, &usize,
2425 usize = isalloc(tsd_tsdn(tsd), p, config_prof);
2430 *tsd_thread_allocatedp_get(tsd) += usize;
2434 JEMALLOC_VALGRIND_REALLOC(maybe, tsd_tsdn(tsd), p, usize, no, ptr,
2452 size_t usize;
2456 usize = isalloc(tsdn, ptr, config_prof);
2458 return (usize);
2465 size_t usize;
2469 usize = ixallocx_helper(tsdn, ptr, old_usize, size, extra, alignment,
2472 return (usize);
2479 size_t usize_max, usize;
2486 * usize isn't knowable before ixalloc() returns when extra is non-zero.
2489 * prof_realloc() will use the actual usize to decide whether to sample.
2509 usize = ixallocx_prof_sample(tsd_tsdn(tsd), ptr, old_usize,
2512 usize = ixallocx_helper(tsd_tsdn(tsd), ptr, old_usize, size,
2515 if (usize == old_usize) {
2517 return (usize);
2519 prof_realloc(tsd, ptr, usize, tctx, prof_active, false, ptr, old_usize,
2522 return (usize);
2529 size_t usize, old_usize;
2554 usize = old_usize;
2564 usize = ixallocx_prof(tsd, ptr, old_usize, size, extra,
2567 usize = ixallocx_helper(tsd_tsdn(tsd), ptr, old_usize, size,
2570 if (unlikely(usize == old_usize))
2574 *tsd_thread_allocatedp_get(tsd) += usize;
2577 JEMALLOC_VALGRIND_REALLOC(no, tsd_tsdn(tsd), ptr, usize, no, ptr,
2582 return (usize);
2589 size_t usize;
2599 usize = ivsalloc(tsdn, ptr, config_prof);
2601 usize = isalloc(tsdn, ptr, config_prof);
2604 return (usize);
2637 size_t usize;
2642 usize = s2u(size);
2644 usize = sa2u(size, MALLOCX_ALIGN_GET_SPECIFIED(flags));
2646 return (usize);
2654 size_t usize;
2659 usize = inallocx(tsd_tsdn(tsd), size, flags);
2660 assert(usize == isalloc(tsd_tsdn(tsd), ptr, config_prof));
2673 isfree(tsd, ptr, usize, tcache, false);
2675 isfree(tsd, ptr, usize, tcache, true);
2683 size_t usize;
2694 usize = inallocx(tsdn, size, flags);
2695 if (unlikely(usize > HUGE_MAXCLASS))
2699 return (usize);