#pragma once #include struct allocator { void *(*alloc)(const struct allocator *allocator, size_t size, int *rc); void *(*realloc)(const struct allocator *allocator, void *p, size_t size, int *rc); int (*free)(const struct allocator *allocator, void *p); }; struct strict_allocator { const struct allocator *allocator_ul; struct allocator allocator; }; void strict_allocator_init(struct strict_allocator *strict_allocator_init, const struct allocator *allocator_ul); extern const struct allocator stdlib_heap_allocator; extern const struct allocator stdlib_strict_heap_allocator;