Implemented memory management

This commit is contained in:
2020-11-03 16:42:53 +01:00
parent bc6c2bd0c1
commit fba1b6487f
4 changed files with 107 additions and 2 deletions

View File

@@ -1,6 +1,16 @@
#include <stdio.h>
#include <string.h>
#include "magic_memory.h"
int main() {
printf("Hello, World!\n");
magic_memory_t* magic_run = magic_memory_begin();
char* str = (char*)magic_malloc(magic_run, 120);
strcpy(str,"Test string! Hello world!!");
printf("%s",str);
//magic_free(magic_run, str);
magic_cleanup(magic_run); // Free all memory used automagically
return 0;
}