Example #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));
 }
Example #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;
    }
Example #3
0
 public LinkIenumerator(NativeLinkData *dataPtr)
 {
     next = dataPtr->start;
     ptr  = new UIntPtr(null);
 }