From eb35276b42925e69a158087b7d32ce5ac9f82bf7 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 30 Nov 2024 07:45:27 -0600 Subject: [PATCH] Update: Add clarifying documentation to some memory allocation functions. --- level_0/f_memory/c/memory/array.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/level_0/f_memory/c/memory/array.h b/level_0/f_memory/c/memory/array.h index 2f5cc4e..078fde9 100644 --- a/level_0/f_memory/c/memory/array.h +++ b/level_0/f_memory/c/memory/array.h @@ -279,6 +279,9 @@ extern "C" { * This function is only useful for simple structures of the form "{ array, used, size }" where the array is a simple type. * If the simple type that is "array" requires additional memory manipulation on allocation, then do not use this function. * + * This does not guarantee the size increased to be increased by the given step. + * There may be some practices that result in the step being increased by a smaller amount. + * * @param step * The allocation step to use. * @@ -326,6 +329,8 @@ extern "C" { * This function is only useful for simple structures of the form "{ array, used, size }" where the array is a simple type. * If the simple type that is "array" requires additional memory manipulation on allocation, then do not use this function. * + * This does guarantee the size to be increased by the given amount, but only when (used + amount > size). + * * @param amount * A positive number representing how much to increase the size by. * @param width -- 1.8.3.1