Hello.

As I can see, there is no address type. The suggested conversion for C pointers (POINTER : vol Conversion) converts a C pointer to "vol".

As follows from
http://www.polyml.org/docs/CInterface.html#17%20Volatile%20Implementation
, "vol" contains an address of a heap object. If its boolean field "owns" is true, it garbage-collects its heap object.

If a C library requires that freeing a heap object be done explicitely, managing an address to that heap object by "vol" is inefficient and confusing. A "vol" value contains an index of the element of the "vols" array which contains an address of a memory block which contains an address of the heap object. What I really need is an ML integer type that is wide enough to hold a C pointer; I called it "address type".

I'm trying to create a binding to the XCB library ( http://xcb.freedesktop.org/ ). Some functions from XCB don't manage memory (so the Poly/ML garbage collector may be used); some functions are allocating objects, and those objects must be freed by the function "free" or "xcb_disconnect".
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to