Improving our memory debugging infrastructure
about two small fixes we need to improve the memory debugging output of valgrind.
I've been working on a different approach: Instead of asking glib to be gc-friendly and to use malloc instead of g_slice implementation, I wrote
patches for glib to hint valgrind directly. What it means is that glib will continue to use g_slice's complex implementation, and no gc-friendly cleanups, but it will give valgrind hints when a slice of memory is "freed" either using g_slice_free or for example g_array_resize...
With this patch you neither need to set G_DEBUG=gc-friendly, nor G_SLICE=malloc. glib simply picks it up when it's running under valgrind (or on top of ;). The patch also implements a global flag called g_mem_in_checker, that will be set to TRUE when running under valgrind (or other memory checkers in the future). ORBit then can check both this flag and g_mem_gc_friendly to initialize its buffers before writing them out.