memory allocations for libraries used by libvirt

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

 



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

Attachment: pgpQvQ5D90vnU.pgp
Description: Digitale Signatur von OpenPGP


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux