From 5de56096928ca7256a35149e5d1bfc77aa2134bc Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 4 May 2017 13:09:19 +0300 Subject: [PATCH] Ensure messages are a multiple of 8 The compiler will anyway insert padding to ensure the size of the structure is a multiple of 8. That will under Valgrind show up as writes of uninitialized data when the messages are sent over the pipe. Rather than forcing the structure to be aligned on 4 byte boundary we simply expand the id field to an 8 byte type. --- server/core/maxscale/messagequeue.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/core/maxscale/messagequeue.hh b/server/core/maxscale/messagequeue.hh index d0d6c67ce..7aa2cd9ad 100644 --- a/server/core/maxscale/messagequeue.hh +++ b/server/core/maxscale/messagequeue.hh @@ -39,7 +39,7 @@ public: * @param arg1 First argument. * @param arg2 Second argument. */ - explicit MessageQueueMessage(uint32_t id = 0, intptr_t arg1 = 0, intptr_t arg2 = 0) + explicit MessageQueueMessage(uint64_t id = 0, intptr_t arg1 = 0, intptr_t arg2 = 0) : m_id(id) , m_arg1(arg1) , m_arg2(arg2) @@ -61,7 +61,7 @@ public: return m_arg2; } - MessageQueueMessage& set_id(uint32_t id) + MessageQueueMessage& set_id(uint64_t id) { m_id = id; return *this; @@ -80,7 +80,7 @@ public: } private: - uint32_t m_id; + uint64_t m_id; intptr_t m_arg1; intptr_t m_arg2; };