> Yes, something like this can be used internally to pass context when 
> creating a new message body for a message being received.
> 
> However, let's figure out how the API should look like and think about 
> the implemetation afterwards.

I would suggest the following:


// Change the function that's used to allocate any memory
// needed by a context.

typedef void *
(*zmq_alloc_func_t)(void *user_data, void *old_ptr, size_t old_size, size_t 
new_size);

void
zmq_ctx_set_allocator(void *ctx, zmq_alloc_func_t alloc_func, void *user_data);


// Add a ctx parameter to each zmq_msg function:

int zmq_msg_init(void *ctx, zmq_msg_t *msg);
int zmq_msg_init_data(void *ctx, zmq_msg_t *msg,
                       void *data, size_t size,
                       zmq_free_fn *ffn, void *hint);

// etc.


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to