Searched refs:nitems_alloc (Results 1 – 1 of 1) sorted by relevance
547 grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize) in grow_nitems_alloc() argument549 ptrdiff_t addend = (*nitems_alloc >> 1) + 1; in grow_nitems_alloc()552 if (!ckd_add(nitems_alloc, *nitems_alloc, addend) in grow_nitems_alloc()553 && !ckd_mul(&product, *nitems_alloc, itemsize) && product <= INDEX_MAX) in grow_nitems_alloc()556 if (*nitems_alloc <= ((INDEX_MAX - 1) / 3 * 2) / itemsize) { in grow_nitems_alloc()557 *nitems_alloc += addend; in grow_nitems_alloc()558 return *nitems_alloc * itemsize; in grow_nitems_alloc()566 ptrdiff_t *nitems_alloc) in growalloc() argument568 return (nitems < *nitems_alloc in growalloc()570 : xrealloc(ptr, grow_nitems_alloc(nitems_alloc, itemsize))); in growalloc()