Implemented memory management
This commit is contained in:
18
src/magic_memory.h
Normal file
18
src/magic_memory.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by marcsello on 03/11/2020.
|
||||
//
|
||||
|
||||
#ifndef CAFF_PREVIEWER_MAGIC_MEMORY_H
|
||||
#define CAFF_PREVIEWER_MAGIC_MEMORY_H
|
||||
|
||||
typedef struct magic_memory_t {
|
||||
void* next;
|
||||
void *ptr;
|
||||
} magic_memory_t;
|
||||
|
||||
magic_memory_t* magic_memory_begin(void);
|
||||
void* magic_malloc(magic_memory_t* magic_memory, size_t size);
|
||||
void magic_free(magic_memory_t* magic_memory, void* ptr);
|
||||
void magic_cleanup(magic_memory_t* magic_memory);
|
||||
|
||||
#endif //CAFF_PREVIEWER_MAGIC_MEMORY_H
|
||||
Reference in New Issue
Block a user