From 8b7af76fcc18ba936c528a2e877cc76d19780a1a Mon Sep 17 00:00:00 2001 Message-Id: <8b7af76fcc18ba936c528a2e877cc76d19780a1a.1714867102.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 4 Jul 2007 00:39:33 +0100 Subject: [PATCH] Enable gc_mem_gc_friendly ad G_SLICE_CONFIG_ALWAYS_MALLOC, the latter turning out to be critical for running GTK+ and libgc together. Organization: Straylight/Edgeware From: Richard Kettlewell --- .bzrignore | 1 + disobedience/disobedience.c | 5 +++++ 2 files changed, 6 insertions(+) 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); -- [mdw]