aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-18 05:31:35 +0200
committerMattias Andrée <maandree@operamail.com>2015-10-18 05:31:35 +0200
commit68d4eb481ba1f71edc2b2597f1db63345e7cd51b (patch)
tree0b1961f8f090a1548c48ee0aa0c655dd47e62a4d
parentrememalign: check mode (diff)
downloadslibc-68d4eb481ba1f71edc2b2597f1db63345e7cd51b.tar.gz
slibc-68d4eb481ba1f71edc2b2597f1db63345e7cd51b.tar.bz2
slibc-68d4eb481ba1f71edc2b2597f1db63345e7cd51b.tar.xz
m doc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--include/slibc-alloc.h8
-rw-r--r--src/slibc-alloc.c12
2 files changed, 16 insertions, 4 deletions
diff --git a/include/slibc-alloc.h b/include/slibc-alloc.h
index f19982a..3fe31e0 100644
--- a/include/slibc-alloc.h
+++ b/include/slibc-alloc.h
@@ -212,7 +212,7 @@ void* extalloc(void*, size_t, enum extalloc_mode)
* behaviour and pointer alignment can be tuned.
*
* @param ptr The old allocation, see `realloc` for more details.
- * @param boundary The alignment.
+ * @param boundary The alignment, not checked before necessary.
* @param size The new allocation size, see `realloc` for more details.
* @param mode `REMEMALIGN_CLEAR`, `REMEMALIGN_INIT` or
* `REMEMALIGN_MEMCPY`, or both or neither.
@@ -233,8 +233,12 @@ void* rememalign(void*, size_t, size_t, enum rememalign_mode)
* - It will never free `ptr`.
* - The alignment of new pointers can be specified.
*
+ * This function cannot be used to force realignment,
+ * the aligment is applied when it is necessary to
+ * create a new allocation.
+ *
* @param ptr The old allocation, see `realloc` for more details.
- * @param boundary The alignment.
+ * @param boundary The alignment, not checked before necessary.
* @param size The new allocation size, see `realloc` for more details.
* @return The new allocation, see `realloc` for more details.
*
diff --git a/src/slibc-alloc.c b/src/slibc-alloc.c
index e6a294b..2ec324a 100644
--- a/src/slibc-alloc.c
+++ b/src/slibc-alloc.c
@@ -262,8 +262,12 @@ void* extalloc(void* ptr, size_t size, enum extalloc_mode mode)
* This function is similar to `realloc`, however its
* behaviour and pointer alignment can be tuned.
*
+ * This function cannot be used to force realignment,
+ * the aligment is applied when it is necessary to
+ * create a new allocation.
+ *
* @param ptr The old allocation, see `realloc` for more details.
- * @param boundary The alignment.
+ * @param boundary The alignment, not checked before necessary.
* @param size The new allocation size, see `realloc` for more details.
* @param mode `REMEMALIGN_CLEAR`, `REMEMALIGN_INIT` or
* `REMEMALIGN_MEMCPY`, or both or neither.
@@ -334,8 +338,12 @@ void* rememalign(void* ptr, size_t boundary, size_t size, enum rememalign_mode m
* - It will never free `ptr`.
* - The alignment of new pointers can be specified.
*
+ * This function cannot be used to force realignment,
+ * the aligment is applied when it is necessary to
+ * create a new allocation.
+ *
* @param ptr The old allocation, see `realloc` for more details.
- * @param boundary The alignment.
+ * @param boundary The alignment, not checked before necessary.
* @param size The new allocation size, see `realloc` for more details.
* @return The new allocation, see `realloc` for more details.
*