예제 #1
0
 public JsonTypeStack(int length, Allocator label)
 {
     m_Label    = label;
     m_Stack    = (JsonType *)UnsafeUtility.Malloc(length * sizeof(JsonType), UnsafeUtility.AlignOf <JsonType>(), label);
     m_Length   = length;
     m_Position = -1;
 }
예제 #2
0
            void Resize(int length)
            {
                var buffer = UnsafeUtility.Malloc(length * sizeof(JsonType), UnsafeUtility.AlignOf <JsonType>(), m_Label);

                UnsafeUtility.MemCpy(buffer, m_Stack, m_Length * sizeof(JsonType));
                UnsafeUtility.Free(m_Stack, m_Label);
                m_Stack  = (JsonType *)buffer;
                m_Length = length;
            }
예제 #3
0
 public void Dispose()
 {
     UnsafeUtility.Free(m_Stack, m_Label);
     m_Stack = null;
 }