Hi there,

It sounds like you are not using a custom made binding, but are rather
calling out to czmq using a foreign function interface (ffi).

For cl-czmq, a lisp binding for czmq, I call out using the library 'cffi'
and there is a provided function cffi:foreign-free which does the freeing.

If you are using an ffi, look in the ffi documentation. If not, look up the
Smalltalk implementation you're using.

Memory managed languages like lisp and probably Smalltalk generally DO
require you to manually manage the memory in the C area. There is no
sure-fire way they can keep track of malloc'd memory blocks, especially
when these are generated by some library function.

Take czmq's zmsg-recv for example. That creates a zmsg, and the zmsg gets
destroyed if you call zmsg-send. But otherwise you have to call
zmsg-destroy yourself. The reference counting (or whatever) mechanisms are
not in place in the C area.

Cheers,

Luke


On Mon, Aug 19, 2013 at 4:52 PM, [email protected] <
[email protected]> wrote:

> Hello,
>
> I managed to get a CZMQ dll under windows. That fine so far. Actually I
> am not doing "C", but bind it to a smalltalk dialect. Now the problem
> when using (for example): zstr_recv().
>
> It is said that the caller must free the receiving string, but how is
> this done, when you only have a high-level binding and no "free()"
> function to call.
>
> Should czmq offer a free-helper function to make this possible ?
>
>
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
---------------------------------------------------
Dr Lucas Hope - lucas.r.hope@skype
Machine Learning and Software Engineering Consultant
Melbourne, Australia
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to