From 5468f8e3d2e97155207f6cd7613eb3e0c13191ee Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Sat, 6 Dec 2025 18:42:48 +0100 Subject: [PATCH] reformat with_borrow --- cig.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cig.h b/cig.h index 60d377e..df8c95f 100644 --- a/cig.h +++ b/cig.h @@ -78,10 +78,9 @@ allocator_t allocator_from_borrow(borrow_allocator_t *this); // with_borrow(foos_allocator) {bar = foo(foos_allocator, my_allocator); } Using // the return a keyword in the statement following this macro will cause a // guaranteed memory leak. -#define with_borrow(NAME) \ - for (allocator_t NAME = borrow_allocator_create(); NAME.this != NULL; \ - NAME.this = (allocator_reset(NAME), NULL)) \ - for (int UNIQUE = 0; UNIQUE < 1; UNIQUE++) +#define with_borrow(NAME)\ + for (allocator_t NAME = borrow_allocator_create(); NAME.this != NULL; NAME.this = (allocator_reset(NAME), NULL)) \ + for (int UNIQUE = 0; UNIQUE < 1; UNIQUE++) \ // arena allocator /////////////////////////////////////////////////////////////