Esempio n. 1
0
    public void Release(T obj)
    {
#if DEBUG
        NetAssert.False(obj.pooled);
        obj.pooled = true;
#endif

        pool.Push(obj);
    }
Esempio n. 2
0
    public T Acquire()
    {
        T obj;

        if (pool.Count > 0)
        {
            obj = pool.Pop();
        }
        else
        {
            obj = new T();
        }

#if DEBUG
        NetAssert.True(obj.pooled);
        obj.pooled = false;
#endif

        return(obj);
    }
Esempio n. 3
0
 public NetworkArray_Entity(int length, int stride)
     : base(length, stride)
 {
     NetAssert.True(stride == 1);
 }
Esempio n. 4
0
 internal NetworkArray_ProtocolToken(int length, int stride)
     : base(length, stride)
 {
     NetAssert.True(stride == 1);
 }