Merge from branch giga
This commit is contained in:
@@ -1 +0,0 @@
|
||||
D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Control
|
||||
@@ -1,43 +0,0 @@
|
||||
WNDCLASSA
|
||||
AdjustWindowRect
|
||||
ChoosePixelFormat
|
||||
CreateWindowEx
|
||||
DefWindowProc
|
||||
DescribePixelFormat
|
||||
DestroyWindow
|
||||
DispatchMessage
|
||||
FreeLibrary
|
||||
GetDC
|
||||
GetEnhMetaFilePixelFormat
|
||||
GetModuleHandle
|
||||
GetPixelFormat
|
||||
GetProcAddress
|
||||
LoadCursor
|
||||
LoadLibrary
|
||||
PeekMessage
|
||||
PostQuitMessage
|
||||
RegisterClass
|
||||
RegisterClassA
|
||||
ReleaseDC
|
||||
SetPixelFormat
|
||||
ShowWindow
|
||||
SwapBuffers
|
||||
TranslateMessage
|
||||
UpdateWindow
|
||||
wglGetProcAddress
|
||||
wglCreateContext
|
||||
wglCreateLayerContext
|
||||
wglCopyContext
|
||||
wglDeleteContext
|
||||
wglDescribeLayerPlane
|
||||
wglGetCurrentContext
|
||||
wglGetCurrentDC
|
||||
wglGetLayerPaletteEntries
|
||||
wglGetProcAddress
|
||||
wglMakeCurrent
|
||||
wglRealizeLayerPalette
|
||||
wglSetLayerPaletteEntries
|
||||
wglShareLists
|
||||
wglSwapLayerBuffers
|
||||
wglUseFontBitmaps
|
||||
wglUseFontOutlines
|
||||
+15
-32
@@ -32,6 +32,7 @@ using StgSharp.Collections;
|
||||
using StgSharp.Controlling.UsrActivity;
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Graphics;
|
||||
using StgSharp.HighPerformance;
|
||||
using StgSharp.HighPerformance.Memory;
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Model.Step;
|
||||
@@ -56,44 +57,25 @@ namespace StgSharp
|
||||
|
||||
internal static unsafe void Main(string[] args)
|
||||
{
|
||||
World.Init();
|
||||
/**/
|
||||
try
|
||||
{
|
||||
World.Init();
|
||||
HybridLayerSegregatedFitAllocator hlsf = new HybridLayerSegregatedFitAllocator(64 * 400 * 400);
|
||||
|
||||
// HLSF test arena
|
||||
Console.WriteLine(
|
||||
"=== HLSF (Hybrid Layer Segregated Fit Allocator) Test Arena ===\n");
|
||||
HybridLayerSegregatedFitAllocator hlsfAllocator = new HybridLayerSegregatedFitAllocator(1024 * 1024);
|
||||
Stack<HybridLayerSegregatedFitAllocationHandle> handles = [];
|
||||
Matrix<float> m = Matrix<float>.FromHlsf(400, 200, hlsf);
|
||||
|
||||
hlsfAllocator.DisplayEntryLayout(false);
|
||||
for (int c = 0; c < 1; c++)
|
||||
int i = 0, ii = 0;
|
||||
foreach (Matrix<float>.Segment lines in m.GetRowEnumeration())
|
||||
{
|
||||
int i = 0;
|
||||
for (; i < 1024 * 1024 / 1024; i++)
|
||||
i = 0;
|
||||
foreach (MatrixKernel* item in lines)
|
||||
{
|
||||
Console.WriteLine($"{c} cycles: Allocating the {i}th block.");
|
||||
handles.Push(hlsfAllocator.Alloc(1024));
|
||||
hlsfAllocator.DisplayEntryLayout(true);
|
||||
|
||||
Console.ReadKey();
|
||||
i++;
|
||||
Console.WriteLine(i);
|
||||
}
|
||||
Console.WriteLine($"{i} allocs called, {handles.Count} handles collected.");
|
||||
Console.ReadKey();
|
||||
while (handles.TryPop(out HybridLayerSegregatedFitAllocationHandle h))
|
||||
{
|
||||
i--;
|
||||
hlsfAllocator.Free(h);
|
||||
Console.WriteLine($"{c} cycles: The {i}th handle is freed");
|
||||
}
|
||||
if (handles.Count != 0)
|
||||
{
|
||||
Console.WriteLine($"[警告] 第{c}轮后Stack未清空,剩余{handles.Count}个handle未释放!");
|
||||
} else
|
||||
{
|
||||
Console.WriteLine("All handles freed.");
|
||||
}
|
||||
Console.ReadKey();
|
||||
ii++;
|
||||
Console.WriteLine($"============================{ii}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -111,7 +93,8 @@ namespace StgSharp
|
||||
{
|
||||
World.Terminate(0);
|
||||
}
|
||||
/**/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,25 +15,21 @@
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<PackageLicenseExpression> MIT</PackageLicenseExpression>
|
||||
<IncludeSymbols>False</IncludeSymbols>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<Platforms>x64;ARM64</Platforms>
|
||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||
<Configurations>Debug;Release;</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<Optimize>False</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>False</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<Optimize>True</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Optimize>False</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -41,6 +37,11 @@
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Optimize>True</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
||||
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
||||
|
||||
Reference in New Issue
Block a user