summaryrefslogtreecommitdiffstats
path: root/src/alloc.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-11-16 12:25:09 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-12-18 15:37:20 -0500
commit5b38f658ee42bef05cecb6cadec65b25d9e94993 (patch)
tree7ee304714729b360a3d45658ca27358e03cd54e3 /src/alloc.h
parentfd91097055f095fdd827ef8751d9534f59a89404 (diff)
downloadbfs-5b38f658ee42bef05cecb6cadec65b25d9e94993.tar.xz
config: New variadic attr(...) macro
Diffstat (limited to 'src/alloc.h')
-rw-r--r--src/alloc.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/alloc.h b/src/alloc.h
index 7132470..f21ddb9 100644
--- a/src/alloc.h
+++ b/src/alloc.h
@@ -114,8 +114,7 @@ static inline size_t flex_size(size_t align, size_t min, size_t offset, size_t s
* @return
* The allocated memory, or NULL on failure.
*/
-attr_malloc(free, 1)
-attr_aligned_alloc(1, 2)
+attr(malloc(free, 1), aligned_alloc(1, 2))
void *alloc(size_t align, size_t size);
/**
@@ -128,8 +127,7 @@ void *alloc(size_t align, size_t size);
* @return
* The allocated memory, or NULL on failure.
*/
-attr_malloc(free, 1)
-attr_aligned_alloc(1, 2)
+attr(malloc(free, 1), aligned_alloc(1, 2))
void *zalloc(size_t align, size_t size);
/** Allocate memory for the given type. */
@@ -252,7 +250,7 @@ void arena_free(struct arena *arena, void *ptr);
/**
* Allocate an object out of the arena.
*/
-attr_malloc(arena_free, 2)
+attr(malloc(arena_free, 2))
void *arena_alloc(struct arena *arena);
/**
@@ -334,7 +332,7 @@ void varena_free(struct varena *varena, void *ptr, size_t count);
* @return
* The allocated struct, or NULL on failure.
*/
-attr_malloc(varena_free, 2)
+attr(malloc(varena_free, 2))
void *varena_alloc(struct varena *varena, size_t count);
/**