Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c9f344e

Browse files
committed
Make aligned_alloc() __wur too.
We made all the allocation functions in <malloc.h> __wur a while ago, but missed the one that's hidden in <stdlib.h> instead... Change-Id: I53dd90fdac1a6f2da3d6f6edc1a3af1e23a4cdb9
1 parent 8949959 commit c9f344e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libc/include/stdlib.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,16 @@ unsigned long long strtoull(const char* _Nonnull __s, char* _Nullable * _Nullabl
7575

7676
int posix_memalign(void* _Nullable * _Nullable __memptr, size_t __alignment, size_t __size);
7777

78-
void* _Nullable aligned_alloc(size_t __alignment, size_t __size) __INTRODUCED_IN(28);
78+
/**
79+
* [aligned_alloc(3)](https://man7.org/linux/man-pages/man3/aligned_alloc.3.html)
80+
* allocates the given number of bytes with the given alignment.
81+
*
82+
* Returns a pointer to the allocated memory on success and returns a null
83+
* pointer and sets `errno` on failure.
84+
*
85+
* Available since API level 28.
86+
*/
87+
__wur void* _Nullable aligned_alloc(size_t __alignment, size_t __size) __INTRODUCED_IN(28);
7988

8089
double strtod(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr);
8190
long double strtold(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr);

0 commit comments

Comments
 (0)