Commit Graph

2 Commits

Author SHA1 Message Date
Keith Packard via Newlib 588a5e1dde libc/stdlib: Use __builtin_mul_overflow for reallocarray and calloc
This built-in function (available in both gcc and clang) is more
efficient and generates shorter code than open-coding the test.

Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-12 10:09:56 +02:00
Sebastian Huber eb14d0cc64 Add BSD-specific reallocarray()
It is available in FreeBSD, NetBSD and OpenBSD, but not in glibc.  It is
used for example by OpenSSH.
2017-04-04 12:19:18 +02:00