Renaming and cleanup. Begin to use own small arena allocator

This commit is contained in:
2025-08-07 18:52:31 +03:00
parent 37f5d8a198
commit 89a2bee8d2
14 changed files with 280 additions and 23 deletions
+34
View File
@@ -0,0 +1,34 @@
using System;
using System.Threading.Tasks;
using mROA.Implementation;
namespace mROA.Test;
[TestFixture]
public class ConcurrentTest
{
private CircularMemoryManager _cmm;
[SetUp]
public void Setup()
{
_cmm = new CircularMemoryManager(100);
}
[Test]
public void ParallelAlloc()
{
Parallel.For(0, 100, i =>
{
var data = _cmm.AllocSlice(1);
data.Span[0] = 1;
});
var total = _cmm.AllocSlice(100).Span;
if (total.IndexOf((byte)0) == -1)
{
Assert.Pass();
}
Assert.Fail();
}
}