4coder/4coder_lib/4coder_heap.h

44 lines
761 B
C
Raw Normal View History

2018-08-18 08:16:52 +00:00
/*
4coder_heap.h - Preversioning
no warranty implied; use at your own risk
This software is in the public domain. Where that dedication is not
recognized, you are granted a perpetual, irrevocable license to copy,
distribute, and modify this file as you see fit.
*/
// TOP
#if !defined(FCODER_HEAP_H)
#define FCODER_HEAP_H
struct Heap_Basic_Node{
Heap_Basic_Node *next;
Heap_Basic_Node *prev;
};
struct Heap_Node{
union{
struct{
Heap_Basic_Node order;
Heap_Basic_Node alloc;
2019-06-01 23:58:28 +00:00
i32 size;
2018-08-18 08:16:52 +00:00
};
2019-06-01 23:58:28 +00:00
u8 force_size__[64];
2018-08-18 08:16:52 +00:00
};
};
struct Heap{
Heap_Basic_Node in_order;
Heap_Basic_Node free_nodes;
2019-06-01 23:58:28 +00:00
i32 used_space;
i32 total_space;
2018-08-18 08:16:52 +00:00
};
2018-09-30 12:14:47 +00:00
//#define DO_HEAP_CHECKS
2018-08-18 08:16:52 +00:00
#endif
// BOTTOM