void Construct( Type concreteType, IProvider provider, DiContainer container, int initialSize, PoolExpandMethods expandMethod) { Assert.That(concreteType.DerivesFromOrEqual <TContract>()); _expandMethod = expandMethod; _provider = provider; _concreteType = concreteType; _injectContext = new InjectContext(container, concreteType); _inactiveItems = new Stack <TContract>(initialSize); for (int i = 0; i < initialSize; i++) { _inactiveItems.Push(AllocNew()); } }
public MemoryPoolSettings(int initialSize, int maxSize, PoolExpandMethods expandMethod) { InitialSize = initialSize; MaxSize = maxSize; ExpandMethod = expandMethod; }
public MemoryPoolSettings() { InitialSize = 0; MaxSize = int.MaxValue; ExpandMethod = PoolExpandMethods.OneAtATime; }