[libc-commits] [libc] [libc] Share hdrgen declarations between stdlib.h and malloc.h (PR #127278)

Caslyn Tonelli via libc-commits libc-commits at lists.llvm.org
Fri Feb 14 16:17:08 PST 2025


================
@@ -0,0 +1,44 @@
+# This file has declarations that appear both in <stdlib.h> and in <malloc.h>.
+
+functions:
+  - name: aligned_alloc
+    standards:
+      - stdc
+    return_type: void *
+    arguments:
+      - type: size_t
+      - type: size_t
+  - name: calloc
+    standards:
+      - stdc
+    return_type: void *
+    arguments:
+      - type: size_t
+      - type: size_t
+  - name: free
+    standards:
+      - stdc
+    return_type: void
+    arguments:
+      - type: void *
+  - name: malloc
+    standards:
+      - stdc
+    return_type: void *
+    arguments:
+      - type: size_t
+  - name: realloc
+    standards:
+      - stdc
+    return_type: void *
+    arguments:
+      - type: void *
+      - type: size_t
+
+# Note: glibc's <stdlib.h> and <malloc.h> both have these, which are
+# currently missing here:
+#  - name: reallocarray
+#  - name: memalign
+#  - name: valloc
+# Each of those glibc headers also has related functions the other lacks.
+# Only the common subset is mentioned here for future consideration.
----------------
Caslyn wrote:

Thanks for this comment!

https://github.com/llvm/llvm-project/pull/127278


More information about the libc-commits mailing list