[clang] [Clang] Introduce malloc_span attribute (PR #167010)
Marco Elver via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 14 06:14:15 PST 2025
================
@@ -5247,6 +5247,22 @@ yet implemented in clang.
}];
}
+def MallocSpanDocs : Documentation {
+ let Category = DocCatFunction;
+ let Heading = "malloc_span";
+ let Content = [{
+The ``malloc_span`` attribute can be used to mark that a function which acts
+like a system memory allocation function and returns a span-like structure,
+where the returned memory range does not alias storage from any other object
+accessible to the caller.
+
+In this context, a span-like structure is assumed to have two fields, one of
+which is a pointer to the start of theallocated memory and another one is
----------------
melver wrote:
```suggestion
which is a pointer to the start of the allocated memory and another one is
```
https://github.com/llvm/llvm-project/pull/167010
More information about the cfe-commits
mailing list