示例#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);