From: Richard Kettlewell Date: Tue, 3 Jul 2007 23:39:33 +0000 (+0100) Subject: Enable gc_mem_gc_friendly ad G_SLICE_CONFIG_ALWAYS_MALLOC, the latter X-Git-Tag: debian-1_5_99dev8~296 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/8b7af76fcc18ba936c528a2e877cc76d19780a1a Enable gc_mem_gc_friendly ad G_SLICE_CONFIG_ALWAYS_MALLOC, the latter turning out to be critical for running GTK+ and libgc together. --- diff --git a/.bzrignore b/.bzrignore index 24e1ed6..a931754 100644 --- a/.bzrignore +++ b/.bzrignore @@ -85,3 +85,4 @@ sounds/Makefile templates/Makefile .bzr.backup doc/disorder-speaker.8.html +.gdb_history diff --git a/disobedience/disobedience.c b/disobedience/disobedience.c index 8826f4c..28eeeff 100644 --- a/disobedience/disobedience.c +++ b/disobedience/disobedience.c @@ -330,6 +330,11 @@ int main(int argc, char **argv) { mem_init(1); if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale"); + /* Causes GTK+ to 0-fill lots of things, which helps the garbage collector. */ + g_mem_gc_friendly = 1; + /* Causes GTK+ to always use g_malloc() instead of private allocator that + * libgc doesn't know about */ + g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, 1); /* GLib sucks - not const-correct */ g_mem_set_vtable((GMemVTable *)&glib_memvtable); gtk_init(&argc, &argv);