]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/intrusivelist.qh
Also bound the speed reduction
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / intrusivelist.qh
index 9d3ec54c8e76c1f395ccd83b4ea2cfb585e5d7a7..fc0e080eae32fa103333559653d439a403895cb2 100644 (file)
@@ -4,8 +4,11 @@
 
 const int IL_MAX = 128;
 
+ERASEABLE
 void IL_INIT(entity this);
+ERASEABLE
 void IL_DTOR(entity this);
+ERASEABLE
 void IL_ENDFRAME();
 
 /**
@@ -37,6 +40,7 @@ ENDCLASS(IntrusiveList)
 #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);
@@ -46,6 +50,7 @@ bool IL_CONTAINS(IntrusiveList this, entity it)
 /**
  * Push to tail
  */
+ERASEABLE
 entity IL_PUSH(IntrusiveList this, entity it)
 {
        assert(this, return NULL);
@@ -64,6 +69,7 @@ entity IL_PUSH(IntrusiveList this, entity it)
 /**
  * Push to head
  */
+ERASEABLE
 entity IL_UNSHIFT(IntrusiveList this, entity it)
 {
        assert(this, return NULL);
@@ -82,6 +88,7 @@ entity IL_UNSHIFT(IntrusiveList this, entity it)
 /**
  * Pop from tail
  */
+ERASEABLE
 entity IL_POP(IntrusiveList this)
 {
        assert(this, return NULL);
@@ -99,6 +106,7 @@ entity IL_POP(IntrusiveList this)
 /**
  * Pop from head
  */
+ERASEABLE
 entity IL_SHIFT(IntrusiveList this)
 {
        assert(this, return NULL);
@@ -116,11 +124,13 @@ entity IL_SHIFT(IntrusiveList this)
 /**
  * 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;
@@ -179,6 +189,7 @@ int il_links_ptr;
 
 #define IL_LISTS_PER_BIT IL_CEIL(IL_MAX / (3 * 24))
 
+ERASEABLE
 void IL_INIT(IntrusiveList this)
 {
        .entity nextfld, prevfld;
@@ -207,12 +218,14 @@ void IL_INIT(IntrusiveList this)
        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
@@ -232,6 +245,7 @@ void IL_ENDFRAME()
 #endif
 }
 
+ERASEABLE
 void ONREMOVE(entity this)
 {
        if (this.il_lists) {