diff options
Diffstat (limited to 'src/lib/inc/mem.h')
-rw-r--r-- | src/lib/inc/mem.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/inc/mem.h b/src/lib/inc/mem.h new file mode 100644 index 0000000..2aaf4d8 --- /dev/null +++ b/src/lib/inc/mem.h @@ -0,0 +1,18 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef MEM_H +#define MEM_H + +#include <def.h> + +#define malloc(n) ((void *)((HEAP += n) - n)) // TODO: Implement real/better malloc/free +#define free(x) + +extern u32 HEAP; +extern u32 HEAP_START; + +void *memcpy(void *dst, const void *src, u32 n); +void *memset(void *dst, int c, u32 n); +int memcmp(const void *s1, const void *s2, u32 n); + +#endif |