From 6b02e70f7226ba663cec635b64b66ce0fb4c563d Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Thu, 18 Dec 2014 23:30:08 -0500 Subject: [PATCH] Added freelist header --- ya_freelist.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ya_freelist.h diff --git a/ya_freelist.h b/ya_freelist.h new file mode 100644 index 0000000..c8f4cde --- /dev/null +++ b/ya_freelist.h @@ -0,0 +1,39 @@ +/* + * Yet Another Malloc + * ya_freelist.h + */ + +#ifndef YA_FREELIST_H +#define YA_FREELIST_H + +/*----------*/ +/* Includes */ +/*----------*/ + +#include // for intptr_t + +/*------------*/ +/* Data types */ +/*------------*/ + +struct fl { + intptr_t *block; + struct fl *prev; + struct fl *next; +}; + +/*--------------*/ +/* Declarations */ +/*--------------*/ + +struct fl *fl_find(intptr_t min_size); + +void fl_split(struct fl *fl); + +void fl_join_prev(struct fl *fl); + +void fl_join_next(struct fl *fl); + +void fl_join(struct fl *fl); + +#endif