Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AllocSlot()

int System.Data.RBTree< K >.TreePage.AllocSlot ( RBTree< K > tree)
inlinepackage

Definition at line 93 of file RBTree.cs.

94 {
95 int num = 0;
96 int num2 = 0;
97 int num3 = -1;
98 if (_inUseCount < _slots.Length)
99 {
100 for (num = _nextFreeSlotLine; num < _slotMap.Length; num++)
101 {
102 if ((uint)_slotMap[num] < uint.MaxValue)
103 {
104 num3 = 0;
105 num2 = ~_slotMap[num] & (_slotMap[num] + 1);
106 _slotMap[num] |= num2;
107 _inUseCount++;
108 if (_inUseCount == _slots.Length)
109 {
110 tree.MarkPageFull(this);
111 }
112 tree._inUseNodeCount++;
113 num3 = RBTree<K>.GetIntValueFromBitMap((uint)num2);
114 _nextFreeSlotLine = num;
115 num3 = num * 32 + num3;
116 break;
117 }
118 }
119 if (num3 == -1 && _nextFreeSlotLine != 0)
120 {
123 }
124 }
125 return num3;
126 }
readonly Node[] _slots
Definition RBTree.cs:49
readonly int[] _slotMap
Definition RBTree.cs:51
int AllocSlot(RBTree< K > tree)
Definition RBTree.cs:93

References System.Data.RBTree< K >.TreePage._inUseCount, System.Data.RBTree< K >.TreePage._nextFreeSlotLine, System.Data.RBTree< K >.TreePage._slotMap, System.Data.RBTree< K >.TreePage._slots, and System.Data.RBTree< K >.TreePage.AllocSlot().

Referenced by System.Data.RBTree< K >.TreePage.AllocSlot().