#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();
MemoryManager M_std_tracked();

/* Helper functions */

char* M_strdup(MemoryManager mm, const char* str);

#endif /* _MEMORY_MANAGER */
