XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
using System.Runtime.InteropServices;

namespace XFESystem.Kernel;

/// <summary>Allocation-free raw page counts, independent of the managed GC's freed-object count.</summary>
internal static class NativeRuntimeMemoryDiagnostics
{
    [DllImport("libSystem.Native", EntryPoint = "XfeRuntimeRawFreePageCount")]
    [SuppressGCTransition]
    internal static extern ulong FreePages();
    [DllImport("libSystem.Native", EntryPoint = "XfeRuntimeRawTotalPageCount")]
    [SuppressGCTransition]
    internal static extern ulong TotalPages();
    [DllImport("libSystem.Native", EntryPoint = "XfeRuntimeRawLargestFreeRunPages")]
    [SuppressGCTransition]
    internal static extern ulong LargestFreeRunPages();
}