Initial commit
This commit is contained in:
22
src/allocator.c
Normal file
22
src/allocator.c
Normal 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;
|
Reference in New Issue
Block a user