aboutsummaryrefslogtreecommitdiff
path: root/MemoryManager.h
blob: 95f864c5c3d8fb58947f19b490fc11795d752a41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef _MEMORY_MANAGER
#define _MEMORY_MANAGER

#include "Types.h"

typedef struct MemoryManager {
    Result (* const alloc)(struct MemoryManager mm, void **ptr, usize size);
    Result (* const realloc)(struct MemoryManager mm, void **ptr, usize new_size);
    Result (* const free)(struct MemoryManager mm, void **ptr);
    Result (* const destroy)(struct MemoryManager *mm);
    void *priv;
} MemoryManager;

MemoryManager M_std();

#endif /* _MEMORY_MANAGER */