Initial commit
This commit is contained in:
20
include/allocator.h
Normal file
20
include/allocator.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef ALLOCATOR_H
|
||||
#define ALLOCATOR_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct Allocator Allocator;
|
||||
|
||||
Allocator allocator_default(void);
|
||||
|
||||
struct Allocator {
|
||||
void *ctx;
|
||||
|
||||
void *(*alloc)(void *ctx, size_t size);
|
||||
|
||||
void *(*realloc)(void *ctx, void *ptr, size_t old_size, size_t new_size);
|
||||
|
||||
void (*free)(void *ctx, void *ptr, size_t size);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user