internal static void init() { for (int i = 0; i < Constants.BROKER_SLOTS; i++) { _pool[i] = new MovesSearched[0]; } }
internal static MovesSearched GetObject() { int slotID = System.Threading.Thread.CurrentThread.ManagedThreadId & Constants.BROKER_SLOT_MASK; if (_cnt[slotID] == _pool[slotID].Length) { int poolLength = _pool[slotID].Length; MovesSearched[] temp = new MovesSearched[poolLength + Constants.BrokerCapacity]; Array.Copy(_pool[slotID], temp, poolLength); for (int i = 0; i < Constants.BrokerCapacity; i++) { temp[poolLength + i] = new MovesSearched(); } _pool[slotID] = temp; } return(_pool[slotID][_cnt[slotID]++]); }
internal static void init() { for (int i = 0; i < Constants.BROKER_SLOTS; i++) { _pool[i] = new MovesSearched[0]; } }
internal static MovesSearched GetObject() { int slotID = System.Threading.Thread.CurrentThread.ManagedThreadId & Constants.BROKER_SLOT_MASK; if (_cnt[slotID] == _pool[slotID].Length) { int poolLength = _pool[slotID].Length; MovesSearched[] temp = new MovesSearched[poolLength + Constants.BrokerCapacity]; Array.Copy(_pool[slotID], temp, poolLength); for (int i = 0; i < Constants.BrokerCapacity; i++) { temp[poolLength + i] = new MovesSearched(); } _pool[slotID] = temp; } return _pool[slotID][_cnt[slotID]++]; }