[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/4] libxl: add version_info function [and 1 more messages]



On 19/04/10 17:21, Ian Jackson wrote:
Vincent Hanquez writes ("Re: [Xen-devel] [PATCH 3/4] libxl: add version_info 
function [and 1 more messages]"):
On 19/04/10 16:36, Ian Jackson wrote:
I don't think that's correct because memory allocated by libxl_sprintf
does not survive return from libxl into the caller.

It survives as long as the context is not ctx_free. i.e. if the data
need to preserve longer, they will have do be duplicated before freeing
the context.

This is sadly not a really tenable behaviour in the long term because
(a) a long-running caller does not want to free the context (and
necessarily reestablish xenstore connections etc. etc.) (b) the caller
may anyway not be able to free the context if doing so frees data they
are still using.

This is not perfect, and has a (tiny) cost, but it makes writing the current ocaml bindings (and the future python bindings) much easier and much less memory leak prone.

Limiting the number of possible boxes of error type, will definitely help getting XCP ported on libxl.

--
Vincent

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.