| #
42664610
|
| 02-Oct-2025 |
Robert Clausecker <fuz@FreeBSD.org> |
lib/libc: add recallocarray()
This function from OpenBSD is a hybrid of reallocarray() and calloc(). It reallocates an array, clearing any newly allocated items. reallocarray() ultimately originates
lib/libc: add recallocarray()
This function from OpenBSD is a hybrid of reallocarray() and calloc(). It reallocates an array, clearing any newly allocated items. reallocarray() ultimately originates from OpenBSD.
The source is taken from lib/libopenbsd, which now no longer has the function unless when bootstrapping (needed for mandoc).
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52863
show more ...
|
| #
7233893e
|
| 02-Oct-2025 |
Robert Clausecker <fuz@FreeBSD.org> |
lib{c,openbsd}: use ckd_mul() for overflow checking in re(c)allocarray
Summary: This makes the code easier to understand and slightly faster, but requires C23. calloc() would benefit, too, but I d
lib{c,openbsd}: use ckd_mul() for overflow checking in re(c)allocarray
Summary: This makes the code easier to understand and slightly faster, but requires C23. calloc() would benefit, too, but I didn't want to touch the imported jemalloc code base.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D52854
show more ...
|