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