summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes <ludovic.courtes@laas.fr>2006-04-04 21:27:48 +0000
committerLudovic Courtès <ludo@gnu.org>2008-09-05 00:46:46 +0200
commita82e7953257db9d70cd2f05d0d7cbc98153bd10f (patch)
tree042f5fab6bec7dc9c51a82ed005ab408683df6a8
parentc5018a2bbb4e48c57072b6d9bba35197a7c589fa (diff)
downloadguile-a82e7953257db9d70cd2f05d0d7cbc98153bd10f.tar.gz
Fixed GC initialization and static roots.
* libguile/gc.c (scm_storage_prehistory): Call `GC_INIT ()'. Invoke `GC_add_roots ()' as well. (scm_init_gc): Removed call to `GC_init ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-6
-rw-r--r--libguile/gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/gc.c b/libguile/gc.c
index df78a62b3..66cb12816 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -55,6 +55,8 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
#include "libguile/gc.h"
#include "libguile/dynwind.h"
+#include <gc/gc.h>
+
#ifdef GUILE_DEBUG_MALLOC
#include "libguile/debug-malloc.h"
#endif
@@ -700,6 +702,10 @@ scm_getenv_int (const char *var, int def)
void
scm_storage_prehistory ()
{
+ GC_INIT ();
+ GC_add_roots ((char *)scm_sys_protects,
+ (char *)(scm_sys_protects + SCM_NUM_PROTECTS));
+
scm_c_hook_init (&scm_before_gc_c_hook, 0, SCM_C_HOOK_NORMAL);
scm_c_hook_init (&scm_before_mark_c_hook, 0, SCM_C_HOOK_NORMAL);
scm_c_hook_init (&scm_before_sweep_c_hook, 0, SCM_C_HOOK_NORMAL);
@@ -907,7 +913,7 @@ scm_mark_locations (SCM_STACKITEM x[], unsigned long n)
void
scm_init_gc ()
{
- GC_init ();
+ /* `GC_INIT ()' was invoked in `scm_storage_prehistory ()'. */
scm_after_gc_hook = scm_permanent_object (scm_make_hook (SCM_INUM0));
scm_c_define ("after-gc-hook", scm_after_gc_hook);