[zeromq-dev] ØMQ VSM data alignment
Matt Weinstein
matt_weinstein at yahoo.com
Thu Aug 5 12:30:52 CEST 2010
A nice side effect - if you overwrite the end of the VSM you'll know PDQ
On Aug 5, 2010, at 6:08 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Matt Weinstein wrote:
>
>> Yes, but I want to do this:
>>
>> zmq::message_t foo;
>>
>> s.recv(&foo);
>> my_struct const* pstruct = reinterpret_cast<my_struct const*>(foo.data());
>>
>> cout << "Works like magic: " << pstruct->member << ". All your processor
>> are belong to Intel! (*)" << endl;
>>
>> That's the no-copy approach :-)
>>
>> I can do it with malloc() without issue or penalty...
>
> Fair enough. Thus kind of stuff would break on RISC architectures such
> as SPARC.
>
> What about having VSM buffer as the first member of zmq_msg_t?
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list