// // Created by stefan on 10.06.20. // #ifndef BETRIEBSYSTEME_ARENA_LIST_H #define BETRIEBSYSTEME_ARENA_LIST_H #include typedef struct Node { void * value; struct Node * next; struct Node * prev; } Node; typedef struct List { Node * first; Node * last; } List; // This structure manages an arena / memory slab to be used typedef struct ArenaList { List freeList; List activeList; } ArenaList; //Initializes the node array ArenaList alInit(Node * arena, size_t size); // Return -1 if the List is full int alPush(ArenaList* al, void * value); // Return -1 if the Node was already deleted int alRemove(ArenaList* al, Node * node); // Return -1 if the Node was already deleted int alRemoveElem(ArenaList* al, void * value); #endif // BETRIEBSYSTEME_ARENA_LIST_H