Re: Turning off the slice allocator
- From: Tim Janik <timj imendio com>
- To: Matthias Clasen <matthias clasen gmail com>
- Cc: Federico Mena Quintero <federico ximian com>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Turning off the slice allocator
- Date: Mon, 23 Jan 2006 12:58:38 +0100 (CET)
On Fri, 20 Jan 2006, Matthias Clasen wrote:
Federico asked for this earlier, so I sat down and wrote a very
quick patch. It doesn't make everything in SliceConfig available via G_DEBUG,
just the always_malloc flag for now. Thats probably enough for most
people who want to turn off the slice allocator to debug memory overruns.
With the patch, you can do G_DEBUG=always_malloc foobar
to have foobar run without slice allocator. The patch currently
overrides a value set by g_slice_set_config().
Tim, do you think this is good enough ?
hmmm, no. or better, it's not exactly what _i_ had in mind for gslice ;)
i'm currently working on a dedicated G_SLICE_DEBUG (or G_SLICE_CONFIG)
variable that can support different checking/debugging modes, similar to
MALLOC_CHECK_ as documented in glibc's malloc(3).
what i think would be great though is if you reworked your patch to support
G_DEBUG=gc-friendly which sets some glib variable glib_mem_gc_friendly to TRUE.
then, all the #ifdef ENABLE_GC_FRIENDLY statements in glib can be changed to
if (glib_mem_gc_friendly), to enable memory debugging/profiling without
recompilation of glib (and for stock distribution binary packages).
Matthias
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]