tlsf briefly ok, debugging
This commit is contained in:
@@ -53,9 +53,9 @@ namespace StgSharp
|
||||
.InitializeModule();
|
||||
|
||||
// TestRegexAnalyse.Run();
|
||||
TestHlsf();
|
||||
// TestHlsf();
|
||||
|
||||
// HlsfStressTest.Run();
|
||||
TlsfStressTest.Run();
|
||||
|
||||
// TestSwiss();
|
||||
// TestL4Prefetch();
|
||||
|
||||
@@ -85,10 +85,17 @@ namespace StgSharp
|
||||
List<Tlsf.Handle> batch = new(maxCount);
|
||||
for (int i = 0; i < maxCount; i++)
|
||||
{
|
||||
uint sz = sizes[rnd.Next(sizes.Length)];
|
||||
batch.Add(hlsfAllocator.Alloc(sz));
|
||||
|
||||
// Console.WriteLine($"alloced:{i}");
|
||||
try
|
||||
{
|
||||
uint sz = sizes[rnd.Next(sizes.Length)];
|
||||
batch.Add(hlsfAllocator.Alloc(sz));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"alloced:{round},{i}");
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
for (int i = 5; i < maxCount; i += 10)
|
||||
{
|
||||
@@ -99,9 +106,16 @@ namespace StgSharp
|
||||
}
|
||||
for (int i = batch.Count - 1; i >= 0; i--)
|
||||
{
|
||||
hlsfAllocator.Free(batch[i]);
|
||||
|
||||
// Console.WriteLine($"freed:{i}");
|
||||
try
|
||||
{
|
||||
hlsfAllocator.Free(batch[i]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"freed:{round},{i}");
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
if (round % 100 == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user