From a3bef798f54de9629986e39d001ba5324e0a08a3 Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Sat, 11 Nov 2023 23:19:30 -0800 Subject: [PATCH] Change structlayout packing to take less memory --- Simulator/Effects.cs | 2 +- Simulator/SimulationState.cs | 2 +- Solver/SimulationNode.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Simulator/Effects.cs b/Simulator/Effects.cs index 6740e16..e047723 100644 --- a/Simulator/Effects.cs +++ b/Simulator/Effects.cs @@ -4,7 +4,7 @@ namespace Craftimizer.Simulator; -[StructLayout(LayoutKind.Auto)] +[StructLayout(LayoutKind.Sequential, Pack = 1)] public record struct Effects { public byte InnerQuiet; diff --git a/Simulator/SimulationState.cs b/Simulator/SimulationState.cs index 74cac04..2a45241 100644 --- a/Simulator/SimulationState.cs +++ b/Simulator/SimulationState.cs @@ -2,7 +2,7 @@ namespace Craftimizer.Simulator; -[StructLayout(LayoutKind.Auto)] +[StructLayout(LayoutKind.Sequential, Pack = 1)] public record struct SimulationState { public readonly SimulationInput Input; diff --git a/Solver/SimulationNode.cs b/Solver/SimulationNode.cs index a2b8f34..01fe352 100644 --- a/Solver/SimulationNode.cs +++ b/Solver/SimulationNode.cs @@ -6,7 +6,7 @@ namespace Craftimizer.Solver; -[StructLayout(LayoutKind.Auto)] +[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SimulationNode { public readonly SimulationState State;