예제 #1
0
        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));
        }
예제 #2
0
 public static X ScanRentOrNew(this ScanPool <X> p, bool b, int i, string s) =>
 p.ScanRent()?.Init(b, i, s) ?? new X(b, i, s);
예제 #3
0
 public void CreatePools()
 {
     _scanNoScanPool = new ScanPool <X>();
     _scanPool       = new ScanPool <X>();
     _stackPool      = new StackPool <X>();
 }
예제 #4
0
 public static X RentNoScanOrNew(this ScanPool <X> p, bool b, int i, string s) =>
 p.RentNoScan()?.Init(b, i, s) ?? new X(b, i, s);