From 3d8c7d83ad9483280f623171af7e40ccc76cef38 Mon Sep 17 00:00:00 2001 From: Colin McEwan Date: Mon, 31 May 2021 08:47:46 +0100 Subject: [PATCH] Add padding to JackEngineControl to account for inherited data --- common/JackEngineControl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/JackEngineControl.h b/common/JackEngineControl.h index 78d9a42b..b9e5b1d7 100644 --- a/common/JackEngineControl.h +++ b/common/JackEngineControl.h @@ -48,11 +48,14 @@ class JackGraphManager; PRE_PACKED_STRUCTURE struct SERVER_EXPORT JackEngineControl : public JackShmMem { + // Padding to align start of JackEngineControl after inherited JackShmMem data + char fPadding1[ sizeof(UInt32) - sizeof(JackShmMem) % sizeof(UInt32) ]; + // Timer JackFrameTimer fFrameTimer; // Padding to align fTransport - char padding[ sizeof(UInt32) - sizeof(fFrameTimer) % sizeof(UInt32) ]; + char fPadding2[ sizeof(UInt32) - sizeof(fFrameTimer) % sizeof(UInt32) ]; // Shared state JackTransportEngine fTransport; @@ -101,6 +104,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem "fTransport must be aligned within JackEngineControl"); static_assert(offsetof(JackEngineControl, fFrameTimer) % sizeof(UInt32) == 0, "fFrameTimer must be aligned within JackEngineControl"); + fBufferSize = 512; fSampleRate = 48000; fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize);