Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1e546714
Commit
1e546714
authored
Jan 24, 2001
by
Gerd Moellmann
Browse files
(sweep_weak_table): Fix code taking items out of
the hash collision chain. Some cleanup.
parent
2533b69a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
src/fns.c
src/fns.c
+6
-12
No files found.
src/fns.c
View file @
1e546714
...
...
@@ -4345,21 +4345,17 @@ sweep_weak_table (h, remove_entries_p)
for
(
bucket
=
0
;
bucket
<
n
;
++
bucket
)
{
Lisp_Object idx, prev;
Lisp_Object
idx
,
next
,
prev
;
/* Follow collision chain, removing entries that
don't survive this garbage collection. */
idx = HASH_INDEX (h, bucket);
prev
=
Qnil
;
while (
!GC_NILP (idx))
for
(
idx
=
HASH_INDEX
(
h
,
bucket
);
!
GC_NILP
(
idx
)
;
idx
=
next
)
{
int remove_p;
int
i
=
XFASTINT
(
idx
);
Lisp_Object next;
int key_known_to_survive_p, value_known_to_survive_p;
key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i));
int
key_known_to_survive_p
=
survives_gc_p
(
HASH_KEY
(
h
,
i
));
int
value_known_to_survive_p
=
survives_gc_p
(
HASH_VALUE
(
h
,
i
));
int
remove_p
;
if
(
EQ
(
h
->
weak
,
Qkey
))
remove_p
=
!
key_known_to_survive_p
;
...
...
@@ -4380,7 +4376,7 @@ sweep_weak_table (h, remove_entries_p)
{
/* Take out of collision chain. */
if
(
GC_NILP
(
prev
))
HASH_INDEX (h,
i
) = next;
HASH_INDEX
(
h
,
bucket
)
=
next
;
else
HASH_NEXT
(
h
,
XFASTINT
(
prev
))
=
next
;
...
...
@@ -4413,8 +4409,6 @@ sweep_weak_table (h, remove_entries_p)
}
}
}
idx = next;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment