Currently src/libxl/ allocates a bunch of buffers with variants of g_new0() or g_strdup(),
which will be consumed by libxenlight.so. Once the objects which contain these buffers are
not needed anymore, libxenlight.so will release them with ordinary calls to free() in its
*_dispose() API. In other words: libxenlight.so does not use glib.
While the g_malloc docs of today's glib state that (apparently) the mistake of using a
private allocator was recognized and corrected in glib 2.46, the same mistake might occur
again in the future.
I wonder if a patch will be accepted which will add simple wrappers around calloc, strdup,
like libxlCallocWrap and libxlStrupWrap, which provides the buffers expected by
libxenlight.so and which it can simply free() again. Just so that it looks more
"symmetric", as opposed to g_new0()/free() pairs.
Maybe this issue was already evaluated at the time libvirt was converted from virAlloc to
g_new?
Olaf