mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
(SCM_HASHTAB_BUCKET_LOC): Removed.
(scan_weak_hashtables): Rewrote its use with SCM_HASHTAB_BUCKET and SCM_SET_HASHTAB_BUCKET.
This commit is contained in:
parent
509759dd31
commit
12783367ec
2 changed files with 18 additions and 15 deletions
|
@ -228,19 +228,24 @@ scan_weak_hashtables (void *dummy1 SCM_UNUSED,
|
||||||
int check_size_p = 0;
|
int check_size_p = 0;
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
{
|
{
|
||||||
SCM *next_spine = SCM_HASHTABLE_BUCKET_LOC (h, i);
|
SCM *next_spine = NULL;
|
||||||
for (alist = *next_spine;
|
alist = SCM_HASHTABLE_BUCKET (h, i);
|
||||||
!scm_is_null (alist);
|
while (scm_is_pair (alist))
|
||||||
alist = SCM_CDR (alist))
|
{
|
||||||
if ((weak_car && UNMARKED_CELL_P (SCM_CAAR (alist)))
|
if ((weak_car && UNMARKED_CELL_P (SCM_CAAR (alist)))
|
||||||
|| (weak_cdr && UNMARKED_CELL_P (SCM_CDAR (alist))))
|
|| (weak_cdr && UNMARKED_CELL_P (SCM_CDAR (alist))))
|
||||||
{
|
{
|
||||||
*next_spine = SCM_CDR (alist);
|
if (next_spine)
|
||||||
SCM_HASHTABLE_DECREMENT (h);
|
*next_spine = SCM_CDR (alist);
|
||||||
check_size_p = 1;
|
else
|
||||||
}
|
SCM_SET_HASHTABLE_BUCKET (h, i, SCM_CDR (alist));
|
||||||
else
|
SCM_HASHTABLE_DECREMENT (h);
|
||||||
next_spine = SCM_CDRLOC (alist);
|
check_size_p = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
next_spine = SCM_CDRLOC (alist);
|
||||||
|
alist = SCM_CDR (alist);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (check_size_p
|
if (check_size_p
|
||||||
&& SCM_HASHTABLE_N_ITEMS (h) < SCM_HASHTABLE_LOWER (h))
|
&& SCM_HASHTABLE_N_ITEMS (h) < SCM_HASHTABLE_LOWER (h))
|
||||||
|
|
|
@ -65,8 +65,6 @@ extern scm_t_bits scm_tc16_hashtable;
|
||||||
SCM_SIMPLE_VECTOR_REF (SCM_HASHTABLE_VECTOR (h), i)
|
SCM_SIMPLE_VECTOR_REF (SCM_HASHTABLE_VECTOR (h), i)
|
||||||
#define SCM_SET_HASHTABLE_BUCKET(h, i, x) \
|
#define SCM_SET_HASHTABLE_BUCKET(h, i, x) \
|
||||||
SCM_SIMPLE_VECTOR_SET (SCM_HASHTABLE_VECTOR (h), i, x)
|
SCM_SIMPLE_VECTOR_SET (SCM_HASHTABLE_VECTOR (h), i, x)
|
||||||
#define SCM_HASHTABLE_BUCKET_LOC(h, i) \
|
|
||||||
SCM_SIMPLE_VECTOR_LOC (SCM_HASHTABLE_VECTOR (h), i)
|
|
||||||
|
|
||||||
typedef struct scm_t_hashtable {
|
typedef struct scm_t_hashtable {
|
||||||
int flags; /* properties of table */
|
int flags; /* properties of table */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue