[libc-commits] [libc] 5156147 - [libc] Declare reallocarray in stdlib.h / malloc.h (#184223)

via libc-commits libc-commits at lists.llvm.org
Mon Mar 2 13:47:47 PST 2026


Author: Roland McGrath
Date: 2026-03-02T13:47:43-08:00
New Revision: 5156147824be8c86c438958f439fc6a13923408a

URL: https://github.com/llvm/llvm-project/commit/5156147824be8c86c438958f439fc6a13923408a
DIFF: https://github.com/llvm/llvm-project/commit/5156147824be8c86c438958f439fc6a13923408a.diff

LOG: [libc] Declare reallocarray in stdlib.h / malloc.h (#184223)

Scudo now provides reallocarray, so declare it.

Added: 
    

Modified: 
    libc/include/stdlib-malloc.yaml

Removed: 
    


################################################################################
diff  --git a/libc/include/stdlib-malloc.yaml b/libc/include/stdlib-malloc.yaml
index 51c11f5602e2c..e1dab21bfc213 100644
--- a/libc/include/stdlib-malloc.yaml
+++ b/libc/include/stdlib-malloc.yaml
@@ -1,10 +1,5 @@
 # This file has declarations that appear both in <stdlib.h> and in <malloc.h>.
 # These include the subset of GNU extensions that Scudo supports.
-#
-# Note: glibc's <stdlib.h> and <malloc.h> both also have `reallocarray`,
-# which Scudo does not support and is omitted here.  (Each of those glibc
-# headers also has related functions the other lacks, but those should be
-# covered separately in stdlib.yaml and malloc.yaml instead.)
 
 functions:
   - name: aligned_alloc
@@ -47,6 +42,15 @@ functions:
     arguments:
       - type: void *
       - type: size_t
+  - name: reallocarray
+    standards:
+      - bsd
+      - gnu
+    return_type: void *
+    arguments:
+      - type: void *
+      - type: size_t
+      - type: size_t
   - name: valloc
     standards:
       - bsd


        


More information about the libc-commits mailing list