Searched refs:nitems_alloc (Results 1 – 1 of 1) sorted by relevance
644 grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize) in grow_nitems_alloc() argument646 ptrdiff_t addend = (*nitems_alloc >> 1) + 1; in grow_nitems_alloc()649 if (!ckd_add(nitems_alloc, *nitems_alloc, addend) in grow_nitems_alloc()650 && !ckd_mul(&product, *nitems_alloc, itemsize) && product <= INDEX_MAX) in grow_nitems_alloc()653 if (*nitems_alloc <= ((INDEX_MAX - 1) / 3 * 2) / itemsize) { in grow_nitems_alloc()654 *nitems_alloc += addend; in grow_nitems_alloc()655 return *nitems_alloc * itemsize; in grow_nitems_alloc()663 ptrdiff_t *nitems_alloc) in growalloc() argument665 return (nitems < *nitems_alloc in growalloc()667 : xrealloc(ptr, grow_nitems_alloc(nitems_alloc, itemsize))); in growalloc()