Initial release version

* Code cleanup
* Fix some TODOs
* Reduce heap allocation use and replace with arena allocation
This commit is contained in:
gingerBill
2016-07-09 00:31:57 +01:00
parent 9ba2a6d02c
commit f7a669d342
14 changed files with 598 additions and 254 deletions

View File

@@ -46,6 +46,23 @@ gb_inline u64 hash_pointer(void *ptr) {
return p;
}
// Doubly Linked Lists
#define DLIST_SET(curr_element, next_element) do { \
(curr_element)->next = (next_element); \
(curr_element)->next->prev = (curr_element); \
(curr_element) = (curr_element)->next; \
} while (0)
#define DLIST_APPEND(root_element, curr_element, next_element) do { \
if ((root_element) == NULL) \
(root_element) = (curr_element) = (next_element); \
else \
DLIST_SET(curr_element, next_element); \
} while (0)
////////////////////////////////////////////////////////////////
//
// Generic Data Structures