diff options
Diffstat (limited to 'libguile/gc.c')
-rw-r--r-- | libguile/gc.c | 113 |
1 files changed, 51 insertions, 62 deletions
diff --git a/libguile/gc.c b/libguile/gc.c index 4478128c6..5bbe1d968 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, - * 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016 Free Software Foundation, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ +/* Copyright 1995-2003,2006,2008-2014,2016-2018 + Free Software Foundation, Inc. + + This file is part of Guile. + + Guile is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Guile is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Guile. If not, see + <https://www.gnu.org/licenses/>. */ /* #define DEBUGINFO */ @@ -23,55 +23,52 @@ # include <config.h> #endif -#include "libguile/gen-scmconfig.h" - #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <math.h> +#include <unistd.h> -#ifdef __ia64__ -#include <ucontext.h> -extern unsigned long * __libc_ia64_register_backing_store_base; +#include "arrays.h" +#include "async.h" +#include "bdw-gc.h" +#include "deprecation.h" +#include "dynwind.h" +#include "eval.h" +#include "gen-scmconfig.h" +#include "gsubr.h" +#include "hashtab.h" +#include "hooks.h" +#include "list.h" +#include "modules.h" +#include "numbers.h" +#include "pairs.h" +#include "ports.h" +#include "simpos.h" +#include "smob.h" +#include "stackchk.h" +#include "stime.h" +#include "strings.h" +#include "struct.h" +#include "symbols.h" +#include "vectors.h" + +#ifdef GUILE_DEBUG_MALLOC +#include "debug-malloc.h" #endif -#include "libguile/_scm.h" -#include "libguile/eval.h" -#include "libguile/stime.h" -#include "libguile/stackchk.h" -#include "libguile/struct.h" -#include "libguile/smob.h" -#include "libguile/arrays.h" -#include "libguile/async.h" -#include "libguile/ports.h" -#include "libguile/simpos.h" -#include "libguile/strings.h" -#include "libguile/vectors.h" -#include "libguile/hashtab.h" -#include "libguile/tags.h" - -#include "libguile/validate.h" -#include "libguile/deprecation.h" -#include "libguile/gc.h" -#include "libguile/dynwind.h" - -#include "libguile/bdw-gc.h" +#include "gc.h" /* For GC_set_start_callback. */ #include <gc/gc_mark.h> -#ifdef GUILE_DEBUG_MALLOC -#include "libguile/debug-malloc.h" -#endif - -#include <unistd.h> /* Size in bytes of the initial heap. This should be about the size of result of 'guile -c "(display (assq-ref (gc-stats) 'heap-total-allocated))"'. */ -#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_SCM_T_BITS) +#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_UINTPTR_T) /* Set this to != 0 if every cell that is accessed shall be checked: */ @@ -480,9 +477,9 @@ scm_storage_prehistory () /* We only need to register a displacement for those types for which the higher bits of the type tag are used to store a pointer (that is, a - pointer to an 8-octet aligned region). For `scm_tc3_struct', this is - handled in `scm_alloc_struct ()'. */ + pointer to an 8-octet aligned region). */ GC_REGISTER_DISPLACEMENT (scm_tc3_cons); + GC_REGISTER_DISPLACEMENT (scm_tc3_struct); /* GC_REGISTER_DISPLACEMENT (scm_tc3_unused); */ /* Sanity check. */ @@ -496,8 +493,6 @@ scm_storage_prehistory () scm_c_hook_init (&scm_after_gc_c_hook, 0, SCM_C_HOOK_NORMAL); } -scm_i_pthread_mutex_t scm_i_gc_admin_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER; - void scm_init_gc_protect_object () { @@ -548,7 +543,7 @@ queue_after_gc_hook (void * hook_data SCM_UNUSED, void *fn_data SCM_UNUSED, void *data SCM_UNUSED) { - scm_i_thread *t = SCM_I_CURRENT_THREAD; + scm_thread *t = SCM_I_CURRENT_THREAD; if (scm_is_false (SCM_CDR (after_gc_async_cell))) { @@ -631,7 +626,7 @@ scm_init_gc () GC_set_warn_proc (scm_gc_warn_proc); GC_set_start_callback (run_before_gc_c_hook); -#include "libguile/gc.x" +#include "gc.x" } @@ -643,9 +638,3 @@ scm_gc_sweep (void) fprintf (stderr, "%s: doing nothing\n", FUNC_NAME); } #undef FUNC_NAME - -/* - Local Variables: - c-file-style: "gnu" - End: -*/ |