Setting G_SLICE=always_malloc at runtime



Hi All,
I'm writing a binding for Gtk to my programming language Wrapl, and
want to make sure that all memory is allocated by the Hans-Boehm
garbage collector. The glib/gobject shared libraries are loaded
dynamically and I call g_mem_set_vtable to change to GC_malloc,
GC_realloc, GC_free, etc. However g_slice doesn't use these. I know
that setting the environment variable G_SLICE to "always_malloc" will
solve this, but I want to do this at runtime, just after the relevant
shared libraries are loaded, but before they are used (basically at
the same time as when I'd call g_mem_set_vtable).
Is this possible?
Thanks,
Raja



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