示例#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 void CreatePools()
 {
     _scanNoScanPool = new ScanPool <X>();
     _scanPool       = new ScanPool <X>();
     _stackPool      = new StackPool <X>();
 }
示例#3
0
 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);