Searched refs:nitems_alloc (Results 1 – 1 of 1) sorted by relevance
558 grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize) in grow_nitems_alloc() argument560 ptrdiff_t addend = (*nitems_alloc >> 1) + 1; in grow_nitems_alloc()563 if (!ckd_add(nitems_alloc, *nitems_alloc, addend) in grow_nitems_alloc()564 && !ckd_mul(&product, *nitems_alloc, itemsize) && product <= INDEX_MAX) in grow_nitems_alloc()567 if (*nitems_alloc <= ((INDEX_MAX - 1) / 3 * 2) / itemsize) { in grow_nitems_alloc()568 *nitems_alloc += addend; in grow_nitems_alloc()569 return *nitems_alloc * itemsize; in grow_nitems_alloc()577 ptrdiff_t *nitems_alloc) in growalloc() argument579 return (nitems < *nitems_alloc in growalloc()581 : xrealloc(ptr, grow_nitems_alloc(nitems_alloc, itemsize))); in growalloc()