[zeromq-dev] zmq_msg_init_data with zero deallocation function

Ivan Pechorin ivan.pechorin at gmail.com
Wed May 11 17:03:37 CEST 2011


2011/5/11 Dirkjan Ochtman <dirkjan at ochtman.nl>:
>> Is the code
>> ==
>> zmq_msg_t msg;
>> zmq_msg_init_data (&msg, (void *)"something", 9,  NULL, NULL);
>> ==
>> valid?
>
> I think in this case "something" is allocated on the stack.

It's more likely that it will be kept in read-only data section, not on stack.
Therefore, the code snippet cited above should work fine.



More information about the zeromq-dev mailing list