mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
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
This commit is contained in:
parent
59cac9e3d8
commit
ce66606641
5 changed files with 0 additions and 119 deletions
|
@ -400,47 +400,9 @@ hashtable_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
return 1;
|
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 */
|
/* keep track of hash tables that need to shrink after scan */
|
||||||
static SCM to_rehash = SCM_EOL;
|
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 *
|
static void *
|
||||||
rehash_after_gc (void *dummy1 SCM_UNUSED,
|
rehash_after_gc (void *dummy1 SCM_UNUSED,
|
||||||
|
|
|
@ -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 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_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_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);
|
SCM_API SCM scm_hash_fn_create_handle_x (SCM table, SCM obj, SCM init, unsigned long (*hash_fn) (), SCM (*assoc_fn) (), void * closure);
|
||||||
|
|
|
@ -109,20 +109,6 @@ scm_c_define_subr_with_generic (const char *name,
|
||||||
return subr;
|
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
|
#ifdef CCLO
|
||||||
SCM
|
SCM
|
||||||
|
|
|
@ -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 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 (const char *name, long type, SCM (*fcn)());
|
||||||
SCM_API SCM scm_c_make_subr_with_generic (const char *name, long type,
|
SCM_API SCM scm_c_make_subr_with_generic (const char *name, long type,
|
||||||
|
|
|
@ -191,74 +191,9 @@ SCM_DEFINE (scm_doubly_weak_alist_vector_p, "doubly-weak-alist-vector?", 1, 0, 0
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#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
|
||||||
scm_init_weaks_builtins ()
|
scm_init_weaks_builtins ()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue