[PATCH] D123088: attributes: introduce allockind attr for describing allocator fn behavior

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 05:06:09 PDT 2022


aykevl added inline comments.


================
Comment at: llvm/docs/LangRef.rst:1584
+     * "alloc": the function returns a new block of memory, or null if the
+       allocation fails
+     * "realloc": the function returns a new block of memory or null. If the
----------------
Is it worth saying something about `alloc(0)`? C `malloc(0)` may or may not return NULL depending on the implementation:

> If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned to indicate an error, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123088/new/

https://reviews.llvm.org/D123088



More information about the llvm-commits mailing list