diff --git a/alloc.c b/alloc.c index 931b9fd59da6368f6a48cfa9f681133f918b162b..b2191b6fc793971235502913c9f65b3224840878 100644 --- a/alloc.c +++ b/alloc.c @@ -1 +1,7 @@ #include "alloc.h" +#include <stdint.h> + +void *m_malloc(size_t size) +{ + +} diff --git a/alloc.h b/alloc.h index 3245f55c3496bc75c70c04625ca3dcb7dd5d0afd..abd79ac63e537ab4833a5397f8c1516f8d158261 100644 --- a/alloc.h +++ b/alloc.h @@ -1,7 +1,13 @@ #ifndef _ALLOC_H_ #define _ALLOC_H_ +#include <stdint.h> typedef struct meta_struct { + int* prev; + int* next; + uint_32_t free; // free == true 이면 비어있는 공간 + // free == faluse 이면 할당되어있는공간 + uint_32_t size; } meta; diff --git a/main b/main new file mode 100755 index 0000000000000000000000000000000000000000..3de2bc66dc6b1dc2999d4d65f62885be05fda0e9 Binary files /dev/null and b/main differ diff --git a/main.c b/main.c index b5fba0682b01a1005462aa24bf4ac2f21227e156..6d04c60d1587753e2c07b67734c1afd54d727328 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,11 @@ #include "alloc.h" +#include <sys/typed.h> +#include <unistd.h> +#include <stdint.h> int main() { + int brk(*addr); + void *sbrk(intptr_t incr); return 0; }