This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH 0 of 3] libxl: memory leaks

On Tue, 2010-08-03 at 11:51 +0100, Vincent Hanquez wrote:
> On 03/08/10 11:18, Gianni Tedesco (3P) wrote:
> > I wasn't aware that was the original design. It's certainly not the case
> > right now.
> it has unfortunately diverged in some calls indeed.
> > AFAICS that scheme would only guarantee everything has been freed if the
> > caller calls ctx_free() at appropriate points. If libxl were used in a
> > daemon, for example, it would not be simple to come up with a scheme
> > that guarantees memory bounds that are independent from uptime.
> This scheme is already in place in the ocaml binding

I actually prefer explicit free's on the returned objects. That gives
callers a lot more control. Have you seen Ians patch auto-generating
that code? I think this approach combined with automatic-freeing of
scratch data used in libxl calls is the best of both worlds.

I don't know about ocaml but assume it's trivial to call a libxl_*_free
function when an object which encapsulates a libxl returned object is

Xen-devel mailing list