diff options
Diffstat (limited to '')
-rw-r--r-- | include/malloc.h | 6 | ||||
-rw-r--r-- | include/stddef.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/malloc.h b/include/malloc.h index 28f937c..66adcbd 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -37,6 +37,8 @@ /** * Create a new memory allocation on the heap. * The allocation will not be initialised. + * The returned pointer has an alignment usable + * for any compiler-independent intrinsic data type. * * @param size The size of the allocation. * @return Pointer to the beginning of the new allocation. @@ -99,7 +101,9 @@ void* zalloc(size_t) /** * Variant of `malloc` that extends, or shrinks, an existing allocation, * if beneficial and possible, or creates a new allocation with the new - * size, copies the data, and frees the old allocation. + * size, copies the data, and frees the old allocation. The returned + * pointer has an alignment usable for any compiler-independent intrinsic + * data type, if a new pointer is returned. * * On error, `ptr` is not freed. * diff --git a/include/stddef.h b/include/stddef.h index e33cfed..50e9ba1 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -82,7 +82,7 @@ #define __NEED_ptrdiff_t #define __NEED_wchar_t #define __NEED_size_t -#if defined(__C11__) +#if defined(__C11__) || defined(__BUILDING_SLIBC) # define __NEED_max_align_t #endif |