[zeromq-dev] Important: backward incompatible changes for 0MQ/3.0!

Pieter Hintjens ph at imatix.com
Fri Mar 25 15:21:46 CET 2011

On Fri, Mar 25, 2011 at 3:14 PM, Douglas Creager <dcreager at dcreager.net> wrote:

> Less invasive to whom?  For the people working on zmq internals, you just have to train yourself to write zmq_malloc instead of malloc.  For the people using zmq, there are two extra parameters to zmq_init, which you can leave as NULL if you want the default system allocator.

It's somewhat more than changing the mallocs. There are only a few of
these, it's 10 minutes to change them. We'd also need to change
constructors and destructors, and any system calls that allocate
memory (strdup is the classic example but libzmq doesn't use that).

Further, I'd not modify the zmq_init call, that's not necessary.
Instead, call a different initializer with extra arguments. We should
not make the same mistake as with iothreads and expose advanced
semantics in the simple API.

Having said this, I'd definitely go for an explicit code-based
framework. My favorite custom allocator just wraps malloc/free but
counting the current consumption, for logging and reporting.


More information about the zeromq-dev mailing list