From 09166d46d6a30c1d431cc8371325d4fc8ae76162 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 14 Jul 2025 09:16:39 -0700 Subject: null instead of 0 --- mem/include/mem.h | 4 ++-- mempool/include/mempool.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mem/include/mem.h b/mem/include/mem.h index 224b069..3050ba8 100644 --- a/mem/include/mem.h +++ b/mem/include/mem.h @@ -68,13 +68,13 @@ /// Allocate a new chunk of N blocks. /// Return a pointer to the first block of the chunk. /// When there is no space left in the allocator, allocation can either trap -/// (default) or gracefully return 0. Call mem_enable_traps() to toggle this +/// (default) or gracefully return null. Call mem_enable_traps() to toggle this /// behaviour. /// New chunks are conveniently zeroed out. #define mem_alloc(MEM, num_blocks) mem_alloc_(&(MEM)->mem, num_blocks) /// Free the chunk. -/// The chunk pointer is conveniently set to 0. +/// The chunk pointer is conveniently set to null. #define mem_free(MEM, CHUNK) mem_free_(&(MEM)->mem, (void**)CHUNK) /// Return a pointer to a chunk given the chunk's handle. diff --git a/mempool/include/mempool.h b/mempool/include/mempool.h index 04d0313..0de7ac6 100644 --- a/mempool/include/mempool.h +++ b/mempool/include/mempool.h @@ -64,15 +64,15 @@ #define mempool_clear(POOL) mempool_clear_(&(POOL)->pool) /// Allocate a new block. -/// Return 0 if there is no memory left. +/// Return null if there is no memory left. /// When there is no space left in the pool, allocation can either trap -/// (default) or gracefully return 0. Call mem_enable_traps() to toggle this +/// (default) or gracefully return null. Call mem_enable_traps() to toggle this /// behaviour. /// New blocks are conveniently zeroed out. #define mempool_alloc(POOL) mempool_alloc_(&(POOL)->pool) /// Free the block. -/// The block pointer is conveniently set to 0. +/// The block pointer is conveniently set to null. #define mempool_free(POOL, BLOCK_PTR) \ assert(*BLOCK_PTR); \ mempool_free_(&(POOL)->pool, (void**)BLOCK_PTR) -- cgit v1.2.3