From 67b5362aeacb1cdd67cdf21b9d66c190a4176738 Mon Sep 17 00:00:00 2001 From: Hywon woong Jang <jhw3169@naver.com> Date: Mon, 11 Jun 2018 14:42:27 +0900 Subject: [PATCH] Ver 1.0 Complete free and malloc --- alloc.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/alloc.h b/alloc.h index 3245f55..f417000 100644 --- a/alloc.h +++ b/alloc.h @@ -1,8 +1,33 @@ #ifndef _ALLOC_H_ #define _ALLOC_H_ - +#include <unistd.h> +#include <stdio.h> typedef struct meta_struct { - +struct meta_struct * prev; +struct meta_struct * next; +unsigned int free; +unsigned int size; } meta; +typedef struct meta_manage { +meta * Head; +meta * Tail; +} manage; + +manage META; + +void * m_malloc(size_t size); + +void * m_realloc(void *ptr , size_t size); + +void * m_free (void * ptr); + +void set_link(void); + +meta * search_and_split(size_t size); + +void print_link(void); + +void reverse_print(void); + #endif -- GitLab