aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/malloc.c24
-rw-r--r--src/string/str/strcasecmp.c2
-rw-r--r--src/string/strn/strncasecmp.c2
-rw-r--r--src/strings/bcmp.c2
-rw-r--r--src/strings/bcopy.c2
-rw-r--r--src/strings/bzero.c2
-rw-r--r--src/strings/explicit_bzero.c2
-rw-r--r--src/strings/ffs.c4
-rw-r--r--src/strings/ffsl.c5
-rw-r--r--src/strings/ffsll.c4
-rw-r--r--src/strings/index.c2
-rw-r--r--src/strings/rindex.c2
12 files changed, 50 insertions, 3 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 61ef244..a66c062 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -80,6 +80,8 @@ static void* unaligned_malloc(size_t size)
* 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
@@ -102,6 +104,8 @@ void* malloc(size_t size)
* `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.
@@ -136,6 +140,8 @@ void* calloc(size_t elem_count, size_t elem_size)
*
* 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.
@@ -165,6 +171,8 @@ void* mallocz(size_t size, int clear)
*
* 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
@@ -193,6 +201,8 @@ void* zalloc(size_t size)
*
* 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.
@@ -215,6 +225,8 @@ void* realloc(void* ptr, size_t size)
/**
* 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.
@@ -255,6 +267,8 @@ void cfree(void* ptr, ...)
* As a GNU-compliant slibc extension, memory allocated
* with this function can be freed with `free`.
*
+ * @etymology (Mem)ory alignment.
+ *
* @param boundary The alignment.
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
@@ -304,6 +318,8 @@ void* memalign(size_t boundary, size_t size)
* 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.
@@ -327,6 +343,8 @@ int posix_memalign(void** ptrptr, size_t boundary, size_t size)
* 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
@@ -348,6 +366,8 @@ void* valloc(size_t size)
* 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
@@ -383,6 +403,8 @@ void* pvalloc(size_t size)
* will allocate a bit of extra memory and shift the returned
* pointer so that it is aligned.
*
+ * @etymology (Alig)ned memory (alloc)ation.
+ *
* @param boundary The alignment.
* @param size The number of bytes to allocated.
* @return Pointer to the beginning of the new allocation.
@@ -407,6 +429,8 @@ void* aligned_alloc(size_t boundary, size_t size)
*
* `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`.
*/
diff --git a/src/string/str/strcasecmp.c b/src/string/str/strcasecmp.c
index eb02084..c4b9175 100644
--- a/src/string/str/strcasecmp.c
+++ b/src/string/str/strcasecmp.c
@@ -25,6 +25,8 @@
* Be aware, only ASCII characters are case insensitive, non-ASCII
* characters are case sensitive.
*
+ * @etymology (Str)ing-function: (case) insensitive (c)o(mp)arison.
+ *
* @param a A negative value is returned if this is the lesser.
* @param b A positive value is returned if this is the lesser.
* @return Zero is returned if `a` and `b` are equal, otherwise,
diff --git a/src/string/strn/strncasecmp.c b/src/string/strn/strncasecmp.c
index 919ff36..da9a1ba 100644
--- a/src/string/strn/strncasecmp.c
+++ b/src/string/strn/strncasecmp.c
@@ -25,6 +25,8 @@
* Be aware, only ASCII characters are case insensitive, non-ASCII
* characters are case sensitive.
*
+ * @etymology (Str)ing-function: (n)-bytes, (case) insensitive (c)o(mp)arison.
+ *
* @param a A negative value is returned if this is the lesser.
* @param b A positive value is returned if this is the lesser.
* @param length The maximum number of characters to compare.
diff --git a/src/strings/bcmp.c b/src/strings/bcmp.c
index 3693354..23e6126 100644
--- a/src/strings/bcmp.c
+++ b/src/strings/bcmp.c
@@ -22,6 +22,8 @@
/**
* This function is identical to `memcmp`.
+ *
+ * @etymology (B)uffer: (c)o(mp)are.
*/
int bcmp(const void* a, const void* b, size_t size)
{
diff --git a/src/strings/bcopy.c b/src/strings/bcopy.c
index 47bbc1c..1abeb7c 100644
--- a/src/strings/bcopy.c
+++ b/src/strings/bcopy.c
@@ -23,6 +23,8 @@
/**
* Copy a memory segment to another, possibly overlapping, segment.
*
+ * @etymology (B)uffer: (copy).
+ *
* @param whence The source memory segment.
* @param whither The destination memory segment.
* @param size The number of bytes to copy.
diff --git a/src/strings/bzero.c b/src/strings/bzero.c
index a3cb557..e581b94 100644
--- a/src/strings/bzero.c
+++ b/src/strings/bzero.c
@@ -23,6 +23,8 @@
/**
* Override a memory segment with zeroes.
*
+ * @etymology (B)uffer: (zero) out.
+ *
* @param segment The memory segment to override.
* @param size The size of the memory segment.
*/
diff --git a/src/strings/explicit_bzero.c b/src/strings/explicit_bzero.c
index 00fe4ab..387c666 100644
--- a/src/strings/explicit_bzero.c
+++ b/src/strings/explicit_bzero.c
@@ -33,6 +33,8 @@ void* (*volatile __slibc_explicit_memset)(void*, int, size_t) = memset;
* Unlike `bzero` and `memset`, calls to this function
* cannot be removed, as an optimisation, by the compiler.
*
+ * @etymology (Explicit) version of (`bzero`).
+ *
* @param segment The memory segment to override.
* @param size The size of the memory segment.
*/
diff --git a/src/strings/ffs.c b/src/strings/ffs.c
index 7de35a4..46ad612 100644
--- a/src/strings/ffs.c
+++ b/src/strings/ffs.c
@@ -22,7 +22,9 @@
/**
* Find the first set bit in an integer.
*
- * @param i The integer
+ * @etymology (F)ind (f)irst (s)et bit on `int`.
+ *
+ * @param i The integer.
* @return The value of the least significant set bit, zero if none.
*/
int ffs(int i)
diff --git a/src/strings/ffsl.c b/src/strings/ffsl.c
index 6657769..3116723 100644
--- a/src/strings/ffsl.c
+++ b/src/strings/ffsl.c
@@ -18,10 +18,13 @@
#include <strings.h>
+
/**
* Find the first set bit in an integer.
*
- * @param i The integer
+ * @etymology (F)ind (f)irst (s)et bit on `(l)ong int`.
+ *
+ * @param i The integer.
* @return The value of the least significant set bit, zero if none.
*/
int ffsl(long i)
diff --git a/src/strings/ffsll.c b/src/strings/ffsll.c
index c053fb6..13d4c14 100644
--- a/src/strings/ffsll.c
+++ b/src/strings/ffsll.c
@@ -22,7 +22,9 @@
/**
* Find the first set bit in an integer.
*
- * @param i The integer
+ * @etymology (F)ind (f)irst (s)et bit on `(l)ong (l)ong int`.
+ *
+ * @param i The integer.
* @return The value of the least significant set bit, zero if none.
*/
int ffsll(long long i)
diff --git a/src/strings/index.c b/src/strings/index.c
index 2f46d30..332811d 100644
--- a/src/strings/index.c
+++ b/src/strings/index.c
@@ -24,6 +24,8 @@
* This function is identical to `strchr`.
*
* This is a deprecated BSD extension.
+ *
+ * @etymology (Index) of character.
*/
char* (index)(const char* string, int c)
{
diff --git a/src/strings/rindex.c b/src/strings/rindex.c
index 0ab4ed1..3e39a9e 100644
--- a/src/strings/rindex.c
+++ b/src/strings/rindex.c
@@ -24,6 +24,8 @@
* This function is identical to `strrchr`.
*
* This is a deprecated BSD extension.
+ *
+ * @etymology (R)ight-most (index) of character.
*/
char* (rindex)(const char* string, int c)
{