const int IL_MAX = 128;
+ERASEABLE
void IL_INIT(entity this);
+ERASEABLE
void IL_DTOR(entity this);
+ERASEABLE
void IL_ENDFRAME();
/**
#define IL_LAST(this) (this.il_tail)
#define IL_PEEK(this) (this.il_tail)
+ERASEABLE
bool IL_CONTAINS(IntrusiveList this, entity it)
{
assert(this, return false);
/**
* Push to tail
*/
+ERASEABLE
entity IL_PUSH(IntrusiveList this, entity it)
{
assert(this, return NULL);
/**
* Push to head
*/
+ERASEABLE
entity IL_UNSHIFT(IntrusiveList this, entity it)
{
assert(this, return NULL);
/**
* Pop from tail
*/
+ERASEABLE
entity IL_POP(IntrusiveList this)
{
assert(this, return NULL);
/**
* Pop from head
*/
+ERASEABLE
entity IL_SHIFT(IntrusiveList this)
{
assert(this, return NULL);
/**
* Remove any element, anywhere in the list
*/
+ERASEABLE
void IL_REMOVE(IntrusiveList this, entity it)
{
assert(this, return);
.entity il_next = this.il_nextfld;
.entity il_prev = this.il_prevfld;
+ //assert(!IL_CONTAINS(this, it), return);
entity next = it.(il_next);
entity prev = it.(il_prev);
entity ohead = this.il_head;
#define IL_LISTS_PER_BIT IL_CEIL(IL_MAX / (3 * 24))
+ERASEABLE
void IL_INIT(IntrusiveList this)
{
.entity nextfld, prevfld;
LOG_WARNF("IntrusiveList overflow");
}
+ERASEABLE
void IL_DTOR(IntrusiveList this)
{
IL_CLEAR(this);
il_links[this.il_id] = NULL;
}
+ERASEABLE
void IL_ENDFRAME()
{
#if 0
#endif
}
+ERASEABLE
void ONREMOVE(entity this)
{
if (this.il_lists) {