コード例 #1
0
 public static PooledObject <T> GetPooledObject <T>([NotNull] this ObjectPool <T> pool) where T : class =>
 new PooledObject <T>(pool);
コード例 #2
0
 public static PooledObject <List <TItem> > GetPooledObject <TItem>([NotNull] this ObjectPool <List <TItem> > pool) =>
 new PooledObject <List <TItem> >(pool, p => p.AllocateAndClear(), (p, obj) => p.ClearAndFree(obj));
コード例 #3
0
 public static PooledObject <StringBuilder> GetPooledObject([NotNull] this ObjectPool <StringBuilder> pool) =>
 new PooledObject <StringBuilder>(pool, p => p.AllocateAndClear(), (p, sb) => p.ClearAndFree(sb));
コード例 #4
0
 public static PooledObject <Dictionary <TKey, TValue> > GetPooledObject <TKey, TValue>([NotNull] this ObjectPool <Dictionary <TKey, TValue> > pool) =>
 new PooledObject <Dictionary <TKey, TValue> >(pool, p => p.AllocateAndClear(), (p, obj) => p.ClearAndFree(obj));
コード例 #5
0
 public static PooledObject <T> GetPooledObject <T>([NotNull] this ObjectPool <T> pool, [NotNull] Action <ObjectPool <T>, T> releaser) where T : class =>
 new PooledObject <T>(pool, releaser);