summaryrefslogtreecommitdiff
path: root/src/fe-text/irssi.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-12-23 06:06:14 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-12-23 06:06:14 +0000
commitcdc52b773e09ab0c0a650fdd06c4e20cb5b90e15 (patch)
treedab1519f57b130fc16c67ffc042e82c3afd9f429 /src/fe-text/irssi.c
parent495501c284e35d02e8be1586d941920a12d0a1d7 (diff)
downloadirssi-cdc52b773e09ab0c0a650fdd06c4e20cb5b90e15.zip
--with-gc enables now support for Boehm's GC, if it's found and glib2 is
used. This also enables an extra check for perl library to verify scripts aren't using objects that have already been free'd - while not a fully safe solution it's much better than before :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3063 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/irssi.c')
-rw-r--r--src/fe-text/irssi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index fbb3e0c1..d0bbbc99 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -309,6 +309,17 @@ static void winsock_init(void)
}
#endif
+#ifdef HAVE_GC
+#include <gc/gc.h>
+GMemVTable gc_mem_table = {
+ GC_malloc,
+ GC_realloc,
+ GC_free,
+
+ NULL, NULL, NULL
+};
+#endif
+
int main(int argc, char **argv)
{
static struct poptOption options[] = {
@@ -316,6 +327,10 @@ int main(int argc, char **argv)
{ NULL, '\0', 0, NULL }
};
+#ifdef HAVE_GC
+ g_mem_set_vtable(&gc_mem_table);
+#endif
+
dummy = FALSE;
quitting = FALSE;
core_init_paths(argc, argv);