예제 #1
0
 /// <summary>
 /// 对象分配内存
 /// </summary>
 /// <returns></returns>
 public virtual T Allocate()
 {
     return(objectCacheStack.Count == 0 ? objectFactory.Creat() : objectCacheStack.Pop());
 }
예제 #2
0
 public virtual T Allocate()
 {
     return(mCacheStack.Count > 0 ? mCacheStack.Pop() : mFactory.Creat());
 }