mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 20:59:47 +01:00
VSM data are aligned to 32/64 bit boundary
Till now the VSM buffer was aligned to 16 bit boundary which could possibly cause problems on RISC architectures when accessing the message data in unsafe manner. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "msg.hpp"
|
||||
#include "../include/zmq.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
@@ -29,6 +30,11 @@
|
||||
#include "likely.hpp"
|
||||
#include "err.hpp"
|
||||
|
||||
// Check whether the sizes of public representation of the message (zmq_msg_t)
|
||||
// and private represenation of the message (zmq::msg_t) match.
|
||||
typedef char zmq_msg_size_check
|
||||
[2 * ((sizeof (zmq::msg_t) == sizeof (zmq_msg_t)) != 0) - 1];
|
||||
|
||||
bool zmq::msg_t::check ()
|
||||
{
|
||||
return u.base.type >= type_min && u.base.type <= type_max;
|
||||
|
||||
Reference in New Issue
Block a user