diff options
Diffstat (limited to 'src/alloc.h')
-rw-r--r-- | src/alloc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/alloc.h b/src/alloc.h index f21ddb9..60dd738 100644 --- a/src/alloc.h +++ b/src/alloc.h @@ -168,6 +168,7 @@ void *zalloc(size_t align, size_t size); * @return * The reallocated memory, or NULL on failure. */ +attr(nodiscard, aligned_alloc(2, 4)) void *xrealloc(void *ptr, size_t align, size_t old_size, size_t new_size); /** Reallocate memory for an array. */ @@ -193,6 +194,7 @@ void *xrealloc(void *ptr, size_t align, size_t old_size, size_t new_size); * for (count + 1) elements. On failure, errno will be non-zero, and * ptr will returned unchanged. */ +attr(nodiscard) void *reserve(void *ptr, size_t align, size_t size, size_t count); /** @@ -349,6 +351,7 @@ void *varena_alloc(struct varena *varena, size_t count); * @return * The resized struct, or NULL on failure. */ +attr(nodiscard) void *varena_realloc(struct varena *varena, void *ptr, size_t old_count, size_t new_count); /** @@ -363,6 +366,7 @@ void *varena_realloc(struct varena *varena, void *ptr, size_t old_count, size_t * @return * The resized struct, or NULL on failure. */ +attr(nodiscard) void *varena_grow(struct varena *varena, void *ptr, size_t *count); /** |