Searched refs:nitems_alloc (Results 1 – 1 of 1) sorted by relevance
640 grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize) in grow_nitems_alloc() argument642 ptrdiff_t addend = (*nitems_alloc >> 1) + 1; in grow_nitems_alloc()645 if (!ckd_add(nitems_alloc, *nitems_alloc, addend) in grow_nitems_alloc()646 && !ckd_mul(&product, *nitems_alloc, itemsize) && product <= INDEX_MAX) in grow_nitems_alloc()649 if (*nitems_alloc <= ((INDEX_MAX - 1) / 3 * 2) / itemsize) { in grow_nitems_alloc()650 *nitems_alloc += addend; in grow_nitems_alloc()651 return *nitems_alloc * itemsize; in grow_nitems_alloc()659 ptrdiff_t *nitems_alloc) in growalloc() argument661 return (nitems < *nitems_alloc in growalloc()663 : xrealloc(ptr, grow_nitems_alloc(nitems_alloc, itemsize))); in growalloc()