示例#1
0
 public NativeLinkedList(Allocator alloc, Func <T, T, bool> func)
 {
     isCreated  = true;
     this.alloc = alloc;
     function   = GetManagedPtr(func);
     data       = Malloc <NativeLinkData>(sizeof(NativeLinkData), alloc);
     UnsafeUtility.MemClear(data, sizeof(NativeLinkData));
 }
示例#2
0
    public void Dispose()
    {
        isCreated = false;
        UIntPtr start = data->start;

        for (int i = 0; i < Length; ++i)
        {
            UIntPtr next = new UIntPtr(*GetNextPtr(start));
            UnsafeUtility.Free(start.ToPointer(), alloc);
            start = next;
        }
        UnsafeUtility.Free(data, alloc);
        data = null;
    }
示例#3
0
 public LinkIenumerator(NativeLinkData *dataPtr)
 {
     next = dataPtr->start;
     ptr  = new UIntPtr(null);
 }