From f60047d4b013eb7f75ad4f5c63eda63153a4bf8e Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 8 Sep 2024 20:02:06 +0300 Subject: value is now opaque --- src/mempool.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mempool.h') diff --git a/src/mempool.h b/src/mempool.h index 7d065f5..bca1e31 100644 --- a/src/mempool.h +++ b/src/mempool.h @@ -2,7 +2,7 @@ #define MEMPOOL_H /* To generate use MEMPOOL_GENERATE(id, type, cap), where functions - * _mempool_allocate() and _mempool_free(type *obj) will be prefixed with id + * _mempool_allocate() and _mempool_free(type *obj) will be prefixed with * and can be used to allocate objects of type with objects in * each block */ @@ -10,7 +10,7 @@ #define for_each_block(id, b, head) \ for(struct id##_block *b = (head), *next = NULL; \ b && (next = b->next, 1); b = next) -#define get_last_block(b) \ +#define get_last_block(b) \ while((b)->next != NULL) (b) = (b)->next #define MEMPOOL_GENERATE(id, type, cap) \ @@ -31,9 +31,9 @@ static inline void *_##id##_mempool_init_block(struct id##_block *b) \ { \ b->next = NULL; \ - for(size_t i = 0; i < cap; i++) \ + for(size_t i = 0; i < cap; i++) \ b->chunks[i].next = &b->chunks[i+1]; \ - b->chunks[cap-1].next = NULL; \ + b->chunks[cap-1].next = NULL; \ \ return b->chunks; \ } \ -- cgit v1.2.3