blob: fc9a13d9d5c8266efa3c04ae91eaac9ca7787362 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#pragma once
#include <stddef.h>
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;
|