public static ObjectPool <StringBuilder> CreateStringBuilderPool( this ObjectPoolProvider provider, int initialCapacity, int maximumRetainedCapacity) { var policy = new StringBuilderPooledObjectPolicy { InitialCapacity = initialCapacity, MaximumRetainedCapacity = maximumRetainedCapacity }; return(provider.Create(policy)); }
public override ObjectPool <T> Create <T>(IPooledObjectPolicy <T> policy) { var inner = _inner.Create(policy); return(new LeakTrackingObjectPool <T>(inner)); }
public static ObjectPool <StringBuilder> CreateStringBuilderPool(this ObjectPoolProvider provider) { return(provider.Create <StringBuilder>(new StringBuilderPooledObjectPolicy())); }