Lines Matching refs:size

241 	size_t	s;	/* Request size. */
303 a0ialloc(size_t size, bool zero, bool is_internal)
308 return (iallocztm(TSDN_NULL, size, size2index(size), zero, NULL,
319 a0malloc(size_t size)
321 return (a0ialloc(size, false, true));
337 bootstrap_malloc(size_t size)
339 if (unlikely(size == 0))
340 size = 1;
342 return (a0ialloc(size, false, false));
346 bootstrap_calloc(size_t num, size_t size)
350 num_size = num * size;
352 assert(num == 0 || size == 0);
1363 /* Whether or not allocations of size 0 should be treated as size 1. */
1366 * Whether to assert that allocations are not of size 0 (after any
1445 size_t size, size_t usize, szind_t ind) {
1475 return iallocztm(tsd_tsdn(tsd), size, ind, dopts->zero, tcache, false,
1512 * *size to the product either way.
1515 compute_size_with_overflow(dynamic_opts_t *dopts, size_t *size) {
1524 *size = dopts->item_size * dopts->num_items;
1526 if (unlikely(*size == 0)) {
1531 * We got a non-zero size, but we don't know if we overflowed to get
1539 if (likely(*size / dopts->item_size == dopts->num_items)) {
1550 size_t size = 0;
1573 bool overflow = compute_size_with_overflow(dopts, &size);
1580 if (unlikely(size == 0)) {
1581 size = 1;
1586 assert (size != 0);
1597 ind = size2index(size);
1606 usize = sa2u(size, dopts->alignment);
1654 * alignment path, imalloc_no_sample ind and size (relying only
1678 UTRACE(0, size, allocation);
1696 UTRACE(NULL, size, NULL);
1727 UTRACE(NULL, size, NULL);
1758 je_malloc(size_t size)
1774 dopts.item_size = size;
1783 je_posix_memalign(void **memptr, size_t alignment, size_t size)
1801 dopts.item_size = size;
1811 je_aligned_alloc(size_t alignment, size_t size)
1832 dopts.item_size = size;
1842 je_calloc(size_t num, size_t size)
1858 dopts.item_size = size;
1966 je_realloc(void *ptr, size_t size)
1973 if (unlikely(size == 0)) {
1983 size = 1;
1998 usize = s2u(size);
2004 usize = s2u(size);
2005 ret = iralloc(tsd, extent, ptr, old_usize, size, 0,
2010 /* realloc(NULL, size) is equivalent to malloc(size). */
2011 return je_malloc(size);
2030 UTRACE(ptr, size, ret);
2062 je_memalign(size_t alignment, size_t size)
2081 dopts.item_size = size;
2093 je_valloc(size_t size)
2113 dopts.item_size = size;
2141 JEMALLOC_EXPORT void *(*__malloc_hook)(size_t size) = je_malloc;
2142 JEMALLOC_EXPORT void *(*__realloc_hook)(void *ptr, size_t size) = je_realloc;
2144 JEMALLOC_EXPORT void *(*__memalign_hook)(size_t alignment, size_t size) =
2157 void *__libc_malloc(size_t size) PREALIAS(je_malloc);
2159 void *__libc_realloc(void* ptr, size_t size) PREALIAS(je_realloc);
2160 void *__libc_calloc(size_t n, size_t size) PREALIAS(je_calloc);
2162 void *__libc_valloc(size_t size) PREALIAS(je_valloc);
2183 je_mallocx(size_t size, int flags)
2198 dopts.item_size = size;
2250 size_t size, size_t alignment, size_t *usize, bool zero, tcache_t *tcache,
2266 size, alignment, zero, tcache, arena);
2275 * The allocation did not move, so it is possible that the size
2295 je_rallocx(void *ptr, size_t size, int flags)
2308 assert(size != 0);
2333 usize = (alignment == 0) ? s2u(size) : sa2u(size, alignment);
2336 p = irallocx_prof(tsd, extent, ptr, old_usize, size, alignment,
2341 p = iralloct(tsd_tsdn(tsd), extent, ptr, old_usize, size,
2356 UTRACE(ptr, size, p);
2364 UTRACE(ptr, size, 0);
2371 size_t size, size_t extra, size_t alignment, bool zero)
2375 if (ixalloc(tsdn, extent, ptr, old_usize, size, extra, alignment, zero))
2384 size_t old_usize, size_t size, size_t extra, size_t alignment, bool zero,
2391 usize = ixallocx_helper(tsdn, extent, ptr, old_usize, size, extra,
2399 size_t size, size_t extra, size_t alignment, bool zero)
2414 usize_max = s2u(size+extra);
2417 usize_max = sa2u(size+extra, alignment);
2432 old_usize, size, extra, alignment, zero, tctx);
2435 size, extra, alignment, zero);
2448 je_xallocx(void *ptr, size_t size, size_t extra, int flags)
2457 assert(size != 0);
2458 assert(SIZE_T_MAX - size >= extra);
2467 * The API explicitly absolves itself of protecting against (size +
2471 * Ordinarily, size limit checking is handled deeper down, but here we
2472 * have to check as part of (size + extra) clamping, since we need the
2475 if (unlikely(size > LARGE_MAXCLASS)) {
2479 if (unlikely(LARGE_MAXCLASS - size < extra))
2480 extra = LARGE_MAXCLASS - size;
2483 usize = ixallocx_prof(tsd, extent, ptr, old_usize, size, extra,
2487 size, extra, alignment, zero);
2497 UTRACE(ptr, size, ptr);
2551 inallocx(tsdn_t *tsdn, size_t size, int flags)
2558 usize = s2u(size);
2560 usize = sa2u(size, MALLOCX_ALIGN_GET_SPECIFIED(flags));
2566 je_sdallocx(void *ptr, size_t size, int flags)
2577 usize = inallocx(tsd_tsdn(tsd), size, flags);
2599 je_nallocx(size_t size, int flags)
2604 assert(size != 0);
2612 usize = inallocx(tsdn, size, flags);