Browse Source

Add padding to JackEngineControl to account for inherited data

pull/761/head
Colin McEwan 4 years ago
parent
commit
3d8c7d83ad
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      common/JackEngineControl.h

+ 5
- 1
common/JackEngineControl.h View File

@@ -48,11 +48,14 @@ class JackGraphManager;
PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE
struct SERVER_EXPORT JackEngineControl : public JackShmMem 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 // Timer
JackFrameTimer fFrameTimer; JackFrameTimer fFrameTimer;


// Padding to align fTransport // Padding to align fTransport
char padding[ sizeof(UInt32) - sizeof(fFrameTimer) % sizeof(UInt32) ];
char fPadding2[ sizeof(UInt32) - sizeof(fFrameTimer) % sizeof(UInt32) ];
// Shared state // Shared state
JackTransportEngine fTransport; JackTransportEngine fTransport;
@@ -101,6 +104,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem
"fTransport must be aligned within JackEngineControl"); "fTransport must be aligned within JackEngineControl");
static_assert(offsetof(JackEngineControl, fFrameTimer) % sizeof(UInt32) == 0, static_assert(offsetof(JackEngineControl, fFrameTimer) % sizeof(UInt32) == 0,
"fFrameTimer must be aligned within JackEngineControl"); "fFrameTimer must be aligned within JackEngineControl");

fBufferSize = 512; fBufferSize = 512;
fSampleRate = 48000; fSampleRate = 48000;
fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize); fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize);


Loading…
Cancel
Save