Пример #1
0
 public void Recycle(IPoolAllocatedObject <T> t)
 {
     if (null != t)
     {
         m_UnusedObjects.Enqueue(t.Downcast());
     }
 }
Пример #2
0
 public void Recycle(IPoolAllocatedObject <T> t)
 {
     if (null != t && m_UnusedObjects.Count < m_PoolSize)
     {
         int hashCode = t.GetHashCode();
         if (!m_HashCodes.Contains(hashCode))
         {
             m_HashCodes.Add(hashCode);
             m_UnusedObjects.Enqueue(t.Downcast());
         }
     }
 }