From e5336056db2f6769cd6bea94768e05ff108b2cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Mon, 25 May 2026 00:02:57 +0200 Subject: [PATCH] LARENA_ALLOC_ARRAY: protect macro expansion --- include/larena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/larena.h b/include/larena.h index a0b1823..5ebd907 100644 --- a/include/larena.h +++ b/include/larena.h @@ -100,7 +100,7 @@ struct LArenaTemp { */ #define LARENA_ALLOC_TYPE(allocator, type_) larena_alloc_aligned((allocator), sizeof(type_), _Alignof(type_)) -#define LARENA_ALLOC_ARRAY(allocator, type_, nr_elements) larena_alloc_aligned((allocator), nr_elements * sizeof(type_), _Alignof(type_)) +#define LARENA_ALLOC_ARRAY(allocator, type_, nr_elements_) larena_alloc_aligned((allocator), (nr_elements_) * sizeof(type_), _Alignof(type_)) // Arena size in bytes static inline size_t larena_size(const LArena *arena)