Span access

This commit is contained in:
wrenge 2024-11-11 14:26:35 +03:00
parent 18b544845f
commit 7aeb31d369
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Buffers; using System.Buffers;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;

View File

@ -607,7 +607,8 @@ namespace DotRecast.Detour
{ {
const int batchSize = 32; const int batchSize = 32;
Span<long> polyRefs = stackalloc long[batchSize]; Span<long> polyRefs = stackalloc long[batchSize];
DtPoly[] polys = new DtPoly[batchSize]; using RcRentedArray<DtPoly> polysRent = RcRentedArray.Rent<DtPoly>(batchSize);
Span<DtPoly> polys = polysRent.AsSpan();
int n = 0; int n = 0;
if (tile.data.bvTree != null) if (tile.data.bvTree != null)