Hi,
I am using your latest version ie 5.1.1 but I have a very frequent issue (not consistent) with Slaballocator
public UnsafeSpan GetSpan (int allocatedIndex) seems to be called with a parameter allocatedIndex = -2 which causes the exception few line below :
if (allocatedIndex < sizeof(Header) || allocatedIndex >= data->mem.Length) throw new System.IndexOutOfRangeException($“Invalid allocation {allocatedIndex}”);
Here is the entire callstack :
IndexOutOfRangeException: Invalid allocation -2
Pathfinding.Util.SlabAllocator1[T].GetSpan (System.Int32 allocatedIndex) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Collections/SlabAllocator.cs:93) Pathfinding.HierarchicalGraph+JobRecalculateComponents.RemoveHierarchicalNode (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, System.Boolean removeAdjacentSmallNodes) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Pathfinding/HierarchicalGraph.cs:274) Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Pathfinding/HierarchicalGraph.cs:474) Unity.Jobs.IJobExtensions+JobStruct
1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at :0)
I got another issue the same class when removing cuts from mesh but it does not seem consistent :
Exception: SlabAllocator cannot allocate more than 2^(MaxAllocationSizeIndex-1) elements
Pathfinding.Util.SlabAllocator1[T].ElementsToSizeIndex (System.Int32 nElements) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Collections/SlabAllocator.cs:151) Pathfinding.Util.SlabAllocator
1[T].Realloc (System.Int32& allocatedIndex, System.Int32 nElements) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Collections/SlabAllocator.cs:129)
Pathfinding.Util.SlabAllocator1+List[T].Add (T value) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Collections/SlabAllocator.cs:283) Pathfinding.HierarchicalGraph+JobRecalculateComponents.FindHierarchicalNodeChildren (Pathfinding.HierarchicalGraph hGraph, System.Int32 hierarchicalNode, Pathfinding.GraphNode startNode) (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Pathfinding/HierarchicalGraph.cs:421) Pathfinding.HierarchicalGraph+JobRecalculateComponents.Execute () (at ./Library/PackageCache/com.arongranberg.astar@5.1.1/Core/Pathfinding/HierarchicalGraph.cs:504) Unity.Jobs.IJobExtensions+JobStruct
1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at :0)
Any clue on these issues ?
Thank you in advance