comparison Implab/ObjectPool.cs @ 91:cdaaf4792c22 v2

code cleanup
author cin
date Tue, 14 Oct 2014 09:30:45 +0400
parents abe260860bd6
children 8beee0d11de6
comparison
equal deleted inserted replaced
90:efcb076407a7 91:cdaaf4792c22
19 protected ObjectPool(int size) { 19 protected ObjectPool(int size) {
20 m_size = size; 20 m_size = size;
21 } 21 }
22 22
23 protected ObjectPool() : this(Environment.ProcessorCount+1) { 23 protected ObjectPool() : this(Environment.ProcessorCount+1) {
24 }
25
26 public ObjectPoolWrapper<T> AllocateAuto() {
27
28 return new ObjectPoolWrapper<T>(Allocate(), this);
29 } 24 }
30 25
31 public T Allocate() { 26 public T Allocate() {
32 if (m_disposed) 27 if (m_disposed)
33 throw new ObjectDisposedException(ToString()); 28 throw new ObjectDisposedException(ToString());