perf(fourkit): server gc, fast-path event dispatch, tps probe

This commit is contained in:
itsRevela
2026-04-24 21:31:06 -05:00
parent 6db68bda06
commit b64b1f17db
11 changed files with 486 additions and 57 deletions
+19
View File
@@ -236,6 +236,15 @@ internal static class NativeBridge
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void NativeSetBiomeIdDelegate(int dimId, int x, int z, int biomeId);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void NativeSetHandlerMaskDelegate(uint mask);
internal static NativeSetHandlerMaskDelegate? SetHandlerMask;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int NativeGetServerTickCountDelegate();
internal static NativeGetServerTickCountDelegate? GetServerTickCount;
internal static NativeDamageDelegate? DamagePlayer;
internal static NativeSetHealthDelegate? SetPlayerHealth;
internal static NativeTeleportDelegate? TeleportPlayer;
@@ -439,4 +448,14 @@ internal static class NativeBridge
GetBiomeId = Marshal.GetDelegateForFunctionPointer<NativeGetBiomeIdDelegate>(getBiomeId);
SetBiomeId = Marshal.GetDelegateForFunctionPointer<NativeSetBiomeIdDelegate>(setBiomeId);
}
internal static void SetSubscriptionCallbacks(IntPtr setHandlerMask)
{
SetHandlerMask = Marshal.GetDelegateForFunctionPointer<NativeSetHandlerMaskDelegate>(setHandlerMask);
}
internal static void SetServerCallbacks(IntPtr getServerTickCount)
{
GetServerTickCount = Marshal.GetDelegateForFunctionPointer<NativeGetServerTickCountDelegate>(getServerTickCount);
}
}