diff --git a/Unhinged/Engine/Connection.cs b/Unhinged/Engine/Connection.cs index 0f62317..c8bff5c 100644 --- a/Unhinged/Engine/Connection.cs +++ b/Unhinged/Engine/Connection.cs @@ -28,7 +28,8 @@ public unsafe class Connection : IDisposable /// Header data, no allocations /// public BinaryH1HeaderData BinaryH1HeaderData { get; set; } - public H1HeaderData H1HeaderData { get; set; } + + public H1HeaderData H1HeaderData { get; set; } = null!; /// Used to size the slabs (typically per-worker slab size). /// Bytes per connection for receive. @@ -37,9 +38,9 @@ public Connection(int maxConnections, int inSlabSize, int outSlabSize) { //AlignedAlloc(size, 64) ensures your memory starts at an address that’s a multiple of 64, //matching CPU cache-line size, reducing false sharing and improving SIMD/cache performance. - ReceiveBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)(maxConnections * inSlabSize), 64); + ReceiveBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)(inSlabSize), 64); WriteBuffer = new FixedBufferWriter( - (byte*)NativeMemory.AlignedAlloc((nuint)(maxConnections * outSlabSize), 64), + (byte*)NativeMemory.AlignedAlloc((nuint)(outSlabSize), 64), outSlabSize); } diff --git a/Unhinged/Unhinged.csproj b/Unhinged/Unhinged.csproj index 3982ca6..355b0e1 100644 --- a/Unhinged/Unhinged.csproj +++ b/Unhinged/Unhinged.csproj @@ -10,9 +10,9 @@ Diogo Martins https://github.com/MDA2AV/Unhinged git - 9.0.6 - 9.0.6 - 9.0.6 + 9.0.7 + 9.0.7 + 9.0.7 README.md Unhinged LICENSE