[libc] Treat reallocarray as an external allocator entrypoint (#236918)
This patch adds `reallocarray` to LLVM libc under `stdlib` as
standardized in POSIX.1-2024.
Following maintainer discussion, `reallocarray` is treated as an
external allocator entrypoint (similar to `malloc` and `realloc`),
backed by the underlying allocator (e.g. Scudo):
- Adds `reallocarray` declaration to `libc/include/stdlib-malloc.yaml`
under the POSIX standard.
- Adds `reallocarray` to `libc/utils/docgen/stdlib.yaml` tracking
POSIX.1-2024.
- Declares the external entrypoint in `libc/src/stdlib/CMakeLists.txt`
and `libc/src/stdlib/reallocarray.h`.
- Adds `reallocarray` to external entrypoints across Linux targets
(`x86_64`, `aarch64`, `riscv`).
Fixes #236898.
GitOrigin-RevId: bc4e5edcc91acd866d66f1346afc818b2e16b130
7 files changed