Skip to content

Commit a5a101c

Browse files
committed
SOH allocation issues
#41
1 parent bef346a commit a5a101c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DotRecast.Detour/DtNavMeshQuery.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public class DtNavMeshQuery
4141
public DtNavMeshQuery(DtNavMesh nav)
4242
{
4343
m_nav = nav;
44-
m_tinyNodePool = new DtNodePool();
4544
m_nodePool = new DtNodePool();
4645
m_openList = new DtNodeQueue();
46+
m_tinyNodePool = new DtNodePool();
4747
}
4848

4949
/// Returns random location on navmesh.
@@ -386,7 +386,7 @@ public DtStatus FindRandomPointAroundCircle(long startRef, RcVec3f centerPos, fl
386386
float s = frand.Next();
387387
float t = frand.Next();
388388

389-
float[] areas = new float[randomPolyVerts.Length / 3];
389+
Span<float> areas = stackalloc float[randomPolyVerts.Length / 3];
390390
RcVec3f pt = DtUtils.RandomPointInConvexPoly(randomPolyVerts, randomPolyVerts.Length / 3, areas, s, t);
391391
ClosestPointOnPoly(randomPolyRef, pt, out var closest, out var _);
392392

0 commit comments

Comments
 (0)