public void CreateAndPopulatePools() { _scanPool = new ScanPool <X>(); _scanPool.Return(new X(false, 0, null)); _scanPool.ScanReturn(new X(false, 0, null)); _scanPool.ScanReturn(new X(false, 0, null)); _stackPool = new StackPool <X>(); _stackPool.Return(new X(false, 0, null)); _stackPool.Return(new X(false, 0, null)); }
public void CreatePools() { _scanNoScanPool = new ScanPool <X>(); _scanPool = new ScanPool <X>(); _stackPool = new StackPool <X>(); }
public static X RentOrNew(this StackPool <X> p, bool b, int i, string s) => p.Rent()?.Init(b, i, s) ?? new X(b, i, s);