summaryrefslogtreecommitdiff
path: root/libguile/gc.c
diff options
context:
space:
mode:
authorLudovic Courtes <ludovic.courtes@laas.fr>2006-12-03 21:59:02 +0000
committerLudovic Courtès <ludo@gnu.org>2008-09-10 22:19:49 +0200
commite7bca22779c68b800c75fdad8841440dfeb32f8d (patch)
tree7f3ed2c38379082723d980d153a323e84bed9ec8 /libguile/gc.c
parent8e7b3e98072ef30557a0396367ae8b42170e5507 (diff)
downloadguile-e7bca22779c68b800c75fdad8841440dfeb32f8d.tar.gz
Use thread-local allocation (significant perf. improvement!); added the `boehm-gc.h' header.
* libguile/Makefile.am (modinclude_HEADERS): Added `boehm-gc.h'. * libguile/coop-defs.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/coop-threads.h: Likewise. * libguile/coop.c: Likewise. * libguile/gc.c: Likewise. (scm_storage_prehistory): Invoke `GC_init ()'. * libguile/guardians.c: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/inline.h: Likewise. (scm_double_cell): Use `GC_MALLOC' instead of `GC_malloc'. * libguile/pthread-threads.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/smob.c: Likewise. * libguile/smob.h: Likewise. * libguile/struct.c: Likewise. * libguile/threads.c: Likewise. * libguile/weaks.c: Likewise. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-51
Diffstat (limited to 'libguile/gc.c')
-rw-r--r--libguile/gc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libguile/gc.c b/libguile/gc.c
index 142fd0be9..d8b27d2f5 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -23,6 +23,8 @@
# include <config.h>
#endif
+#include "libguile/gen-scmconfig.h"
+
#include <stdio.h>
#include <errno.h>
#include <string.h>
@@ -55,7 +57,7 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
#include "libguile/gc.h"
#include "libguile/dynwind.h"
-#include <gc/gc.h>
+#include "libguile/boehm-gc.h"
#ifdef GUILE_DEBUG_MALLOC
#include "libguile/debug-malloc.h"
@@ -641,6 +643,13 @@ scm_storage_prehistory ()
GC_all_interior_pointers = 0;
GC_INIT ();
+
+#ifdef SCM_I_GSC_USE_PTHREAD_THREADS
+ /* When using GC 6.8, this call is required to initialize thread-local
+ freelists (shouldn't be necessary with GC 7.0). */
+ GC_init ();
+#endif
+
GC_expand_hp (SCM_DEFAULT_INIT_HEAP_SIZE_2);
/* We only need to register a displacement for those types for which the