aboutsummaryrefslogtreecommitdiffstats
path: root/include/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/malloc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/malloc.h b/include/malloc.h
index 2b2748b..6410ad0 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -40,6 +40,8 @@
* The returned pointer has an alignment usable
* for any compiler-independent intrinsic data type.
*
+ * @etymology (M)emory (alloc)ation.
+ *
* @param size The size of the allocation.
* @return Pointer to the beginning of the new allocation.
* If `size` is zero, this function will either return
@@ -59,6 +61,8 @@ void* malloc(size_t)
* `p = calloc(n, m)` is equivalent to
* `(p = malloc(n * m), p ? (explicit_bzero(p, n * m), p) : NULL)`
*
+ * @etymology (C)leared memory (alloc)ation.
+ *
* @param elem_count The number of elements to allocate.
* @param elem_size The size of each element.
* @return Pointer to the beginning of the new allocation.
@@ -83,6 +87,8 @@ void* calloc(size_t, size_t)
*
* This is a Plan 9 from Bell Labs extension.
*
+ * @etymology (M)emory (alloc)ation with potential (z)eroing.
+ *
* @param size The size of the allocation.
* @param clear Clear the allocation unless this value is zero.
* @return Pointer to the beginning of the new allocation.
@@ -108,6 +114,8 @@ void* mallocz(size_t, int)
*
* This is a klibc extension.
*
+ * @etymology (Z)eroed memory (alloc)ation.
+ *
* @param size The size of the allocation.
* @return Pointer to the beginning of the new allocation.
* If `size` is zero, this function will either return
@@ -132,6 +140,8 @@ void* zalloc(size_t)
*
* On error, `ptr` is not freed.
*
+ * @etymology Memory (realloc)ation.
+ *
* @param ptr Pointer to the beginning of the old memory allocation.
* The process may crash if it does not point to the
* beginning of a memory allocation on the heap.
@@ -152,6 +162,8 @@ void* realloc(void*, size_t)
/**
* Free a memory allocation.
*
+ * @etymology (Free) allocated memory.
+ *
* @param ptr Pointer to the beginning of the memory allocation.
* The process may crash if it does not point to the
* beginning of a memory allocation on the heap.
@@ -189,6 +201,8 @@ void cfree(void*, ...)
* As a GNU-compliant slibc extension, memory allocated
* with this function can be freed with `free`.
*
+ * @etymology (Mem)ory (align)ment.
+ *
* @param boundary The alignment.
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
@@ -217,6 +231,8 @@ void* memalign(size_t, size_t)
* As a GNU-compliant slibc extension, memory allocated
* with this function can be freed with `free`.
*
+ * @etymology (POSIX)-extension: (mem)ory alignment.
+ *
* @param ptrptr Output parameter for the allocated memory.
* @param boundary The alignment.
* @param size The number of bytes to allocated.
@@ -236,6 +252,8 @@ int posix_memalign(void**, size_t, size_t)
* As a GNU-compliant slibc extension, memory allocated
* with this function can be freed with `free`.
*
+ * @etymology Whole-(v)irtual-memory-page aligned memory (alloc)ation.
+ *
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
* If `size` is zero, this function will either return
@@ -256,6 +274,8 @@ void* valloc(size_t)
* including auxiliary space, is rounded up to the next multiple
* of the page size.
*
+ * @etymology Whole-(p)age-allocation variant of (`valloc`).
+ *
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
* If `size` is zero, this function will either return
@@ -282,6 +302,8 @@ void* pvalloc(size_t)
* will allocate a bit of extra memory and shift the returned
* pointer so that it is aligned.
*
+ * @etymology (Align)ed memory (alloc)ation.
+ *
* @param boundary The alignment.
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
@@ -306,6 +328,8 @@ void* aligned_alloc(size_t, size_t)
*
* `p = malloc(n), malloc_usable_size(p)` will return `n`.
*
+ * @etymology (`malloc`)-subsystem: user-(usable size) of allocation.
+ *
* @param segment The memory segment.
* @return The size of the memory segment, 0 if `segment` is `NULL`.
*/