switch C code prefix to NIF

This commit is contained in:
Youmu Liu
2026-09-03 20:04:20 +08:00
parent 7c7101ee48
commit 41ca31fd9a
51 changed files with 1047 additions and 1030 deletions
@@ -75,7 +75,7 @@ namespace Nitload.Common.HighPerformance.ProcessorAbstraction
NumaFreeNative(address, size, numaId);
}
[LibraryImport(Native.LibName, EntryPoint = "sn_get_numa_each")]
[LibraryImport(Native.LibName, EntryPoint = "nif_get_numa_each")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
public static partial int GetNumaEach(
@@ -84,7 +84,7 @@ namespace Nitload.Common.HighPerformance.ProcessorAbstraction
Span<uint> globalCpuIdInNuma
);
[LibraryImport(Native.LibName, EntryPoint = "sn_get_numa_overall")]
[LibraryImport(Native.LibName, EntryPoint = "nif_get_numa_overall")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
public static partial int GetNumaOverall(
@@ -119,7 +119,7 @@ namespace Nitload.Common.HighPerformance.ProcessorAbstraction
}
}
[LibraryImport(Native.LibName, EntryPoint = "sn_set_thread_affinity")]
[LibraryImport(Native.LibName, EntryPoint = "nif_set_thread_affinity")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
internal static partial void SetThreadAffinity(
@@ -138,7 +138,7 @@ namespace Nitload.Common.HighPerformance.ProcessorAbstraction
return new(numaId, count, globalIndex);
}
[LibraryImport(Native.LibName, EntryPoint = "sn_numa_alloc")]
[LibraryImport(Native.LibName, EntryPoint = "nif_numa_alloc")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
private static unsafe partial void* NumaAllocNative(
@@ -146,7 +146,7 @@ namespace Nitload.Common.HighPerformance.ProcessorAbstraction
int numaId
);
[LibraryImport(Native.LibName, EntryPoint = "sn_numa_free")]
[LibraryImport(Native.LibName, EntryPoint = "nif_numa_free")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
private static unsafe partial void NumaFreeNative(