diff -r 02946dc73e6a -r 2fc1c25441f1 src/allocator.c --- a/src/allocator.c Tue May 27 22:23:33 2025 +0200 +++ b/src/allocator.c Tue May 27 22:31:06 2025 +0200 @@ -29,6 +29,7 @@ #include "cx/allocator.h" #include +#include static void *cx_malloc_stdlib( cx_attr_unused void *d, @@ -116,6 +117,17 @@ return allocator->cl->malloc(allocator->data, n); } +void *cxZalloc( + const CxAllocator *allocator, + size_t n +) { + void *mem = allocator->cl->malloc(allocator->data, n); + if (mem != NULL) { + memset(mem, 0, n); + } + return mem; +} + void *cxRealloc( const CxAllocator *allocator, void *mem,