summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes <ludovic.courtes@laas.fr>2006-05-14 18:44:09 +0000
committerLudovic Courtès <ludo@gnu.org>2008-09-05 00:48:31 +0200
commitce6660664198cc05a30ab5f342f8f95d491dbb41 (patch)
tree5648c4b8596d44db8980820eb13ee4b3d46bb65d
parent59cac9e3d8fb0097aba43dd3351274593ec552d7 (diff)
downloadguile-ce6660664198cc05a30ab5f342f8f95d491dbb41.tar.gz
procs/weaks/hashtab: Removed a bit of useless mark/free code.
* libguile/hashtab.c (UNMARKED_CELL_P): Removed. (scm_i_scan_weak_hashtables): Removed. * libguile/hashtab.h (scm_i_scan_weak_hashtables): Removed. * libguile/procs.c (scm_mark_subr_table): Removed. * libguile/procs.h (scm_mark_subr_table): Removed. * libguile/weaks.c (UNMARKED_CELL_P): Removed. (scm_i_remove_weaks): Removed. (scm_i_remove_weaks_from_weak_vectors): Removed. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-18
-rw-r--r--libguile/hashtab.c38
-rw-r--r--libguile/hashtab.h1
-rw-r--r--libguile/procs.c14
-rw-r--r--libguile/procs.h1
-rw-r--r--libguile/weaks.c65
5 files changed, 0 insertions, 119 deletions
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index e55eee5aa..7f882948a 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -400,47 +400,9 @@ hashtable_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
return 1;
}
-/* FIXME */
-#define UNMARKED_CELL_P(x) 0 /* (SCM_NIMP(x) && !SCM_GC_MARK_P (x)) */
-
/* keep track of hash tables that need to shrink after scan */
static SCM to_rehash = SCM_EOL;
-/* scan hash tables and update hash tables item count */
-void
-scm_i_scan_weak_hashtables ()
-{
-#if 0 /* FIXME */
- SCM *next = &weak_hashtables;
- SCM h = *next;
- while (!scm_is_null (h))
- {
- if (!SCM_GC_MARK_P (h))
- *next = h = SCM_HASHTABLE_NEXT (h);
- else
- {
- SCM vec = SCM_HASHTABLE_VECTOR (h);
- size_t delta = SCM_I_WVECT_DELTA (vec);
- SCM_I_SET_WVECT_DELTA (vec, 0);
- SCM_SET_HASHTABLE_N_ITEMS (h, SCM_HASHTABLE_N_ITEMS (h) - delta);
-
- if (SCM_HASHTABLE_N_ITEMS (h) < SCM_HASHTABLE_LOWER (h))
- {
- SCM tmp = SCM_HASHTABLE_NEXT (h);
- /* temporarily move table from weak_hashtables to to_rehash */
- SCM_SET_HASHTABLE_NEXT (h, to_rehash);
- to_rehash = h;
- *next = h = tmp;
- }
- else
- {
- next = SCM_HASHTABLE_NEXTLOC (h);
- h = SCM_HASHTABLE_NEXT (h);
- }
- }
- }
-#endif
-}
static void *
rehash_after_gc (void *dummy1 SCM_UNUSED,
diff --git a/libguile/hashtab.h b/libguile/hashtab.h
index 101735460..dd6931150 100644
--- a/libguile/hashtab.h
+++ b/libguile/hashtab.h
@@ -97,7 +97,6 @@ SCM_API SCM scm_weak_value_hash_table_p (SCM h);
SCM_API SCM scm_doubly_weak_hash_table_p (SCM h);
SCM_API void scm_i_rehash (SCM table, unsigned long (*hash_fn)(), void *closure, const char*func_name);
-SCM_API void scm_i_scan_weak_hashtables (void);
SCM_API SCM scm_hash_fn_get_handle (SCM table, SCM obj, unsigned long (*hash_fn) (), SCM (*assoc_fn) (), void * closure);
SCM_API SCM scm_hash_fn_create_handle_x (SCM table, SCM obj, SCM init, unsigned long (*hash_fn) (), SCM (*assoc_fn) (), void * closure);
diff --git a/libguile/procs.c b/libguile/procs.c
index 2359eae1f..8bf46649b 100644
--- a/libguile/procs.c
+++ b/libguile/procs.c
@@ -109,20 +109,6 @@ scm_c_define_subr_with_generic (const char *name,
return subr;
}
-void
-scm_mark_subr_table ()
-{
- long i;
- for (i = 0; i < scm_subr_table_size; ++i)
- {
- scm_gc_mark (scm_subr_table[i].name);
- if (scm_subr_table[i].generic && *scm_subr_table[i].generic)
- scm_gc_mark (*scm_subr_table[i].generic);
- if (SCM_NIMP (scm_subr_table[i].properties))
- scm_gc_mark (scm_subr_table[i].properties);
- }
-}
-
#ifdef CCLO
SCM
diff --git a/libguile/procs.h b/libguile/procs.h
index 060c8ee42..74627254a 100644
--- a/libguile/procs.h
+++ b/libguile/procs.h
@@ -136,7 +136,6 @@ SCM_API long scm_subr_table_room;
-SCM_API void scm_mark_subr_table (void);
SCM_API void scm_free_subr_entry (SCM subr);
SCM_API SCM scm_c_make_subr (const char *name, long type, SCM (*fcn)());
SCM_API SCM scm_c_make_subr_with_generic (const char *name, long type,
diff --git a/libguile/weaks.c b/libguile/weaks.c
index b27839e48..7950d891b 100644
--- a/libguile/weaks.c
+++ b/libguile/weaks.c
@@ -191,74 +191,9 @@ SCM_DEFINE (scm_doubly_weak_alist_vector_p, "doubly-weak-alist-vector?", 1, 0, 0
}
#undef FUNC_NAME
-#define UNMARKED_CELL_P(x) 1 /* (SCM_NIMP(x) && !SCM_GC_MARK_P (x)) *//*
- FIXME */
-static void
-scm_i_remove_weaks (SCM w)
-{
- return; /* FIXME */
-#if 0
- SCM *ptr = SCM_I_WVECT_GC_WVELTS (w);
- size_t n = SCM_I_WVECT_LENGTH (w);
- size_t i;
-
- if (!SCM_IS_WHVEC_ANY (w))
- {
- for (i = 0; i < n; ++i)
- if (UNMARKED_CELL_P (ptr[i]))
- ptr[i] = SCM_BOOL_F;
- }
- else
- {
- size_t delta = 0;
-
- for (i = 0; i < n; ++i)
- {
- SCM alist, *fixup;
-
- fixup = ptr + i;
- alist = *fixup;
- while (scm_is_pair (alist) && !SCM_GC_MARK_P (alist))
- {
- if (UNMARKED_CELL_P (SCM_CAR (alist)))
- {
- *fixup = SCM_CDR (alist);
- delta++;
- }
- else
- {
- SCM_SET_GC_MARK (alist);
- fixup = SCM_CDRLOC (alist);
- }
- alist = *fixup;
- }
- }
-#if 0
- if (delta)
- fprintf (stderr, "vector %p, delta %d\n", w, delta);
-#endif
- SCM_I_SET_WVECT_DELTA (w, delta);
- }
-#endif
-}
-
-#if 0
-void
-scm_i_remove_weaks_from_weak_vectors ()
-{
- SCM w = weak_vectors;
- while (!scm_is_null (w))
- {
- scm_i_remove_weaks (w);
- w = SCM_I_WVECT_GC_CHAIN (w);
- }
-}
-#endif
-
-
SCM
scm_init_weaks_builtins ()
{