Initial commit

This commit is contained in:
2025-08-28 04:59:23 -07:00
commit 5ac6aaf900
14 changed files with 4983 additions and 0 deletions

22
src/allocator.c Normal file
View File

@ -0,0 +1,22 @@
/**
* @file
* Replaceable memory allocator.
*/
#include "refcount/allocator.h"
#include <stdlib.h>
/**
* Initial value of #refcount_global_allocator.
*/
static const RefcountAllocator default_allocator = {
.malloc = malloc,
.realloc = realloc,
.free = free,
};
/**
* The global #RefcountAllocator used by other parts of RefCount. The default
* value just calls the C standard functions malloc, realloc, and free.
*/
const RefcountAllocator *refcount_global_allocator = &default_allocator;