1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 08:40:19 +02:00

* weaks.c (scm_scan_weak_vectors): move the calculation of the

`weak_keys' and `weak_values' flags out of the inner loop.

	* guardians.c: (greedily_guarded_prop): deleted.
	(greedily_guarded_whash): new variable.  a doubly-weak hash table
	used to keep the "greedily hashed" object property.  the previous
	implementation (via primitive object properties) was incorrect due
	to its only-the-key-is-weak semantics.
	(scm_guard, get_one_zombie, scm_init_guardians): use/init
	`greedily_guarded_whash'.
This commit is contained in:
Michael Livshin 2000-12-29 22:18:06 +00:00
parent 1746633025
commit d9dcd93362
3 changed files with 30 additions and 19 deletions

View file

@ -273,6 +273,8 @@ scm_scan_weak_vectors (void *dummy1, void *dummy2, void *dummy3)
SCM obj = w;
register long n = SCM_VECTOR_LENGTH (w);
register long j;
int weak_keys = SCM_IS_WHVEC (obj) || SCM_IS_WHVEC_B (obj);
int weak_values = SCM_IS_WHVEC_V (obj) || SCM_IS_WHVEC_B (obj);
ptr = SCM_VELTS (w);
@ -280,11 +282,6 @@ scm_scan_weak_vectors (void *dummy1, void *dummy2, void *dummy3)
{
SCM * fixup;
SCM alist;
int weak_keys;
int weak_values;
weak_keys = SCM_IS_WHVEC (obj) || SCM_IS_WHVEC_B (obj);
weak_values = SCM_IS_WHVEC_V (obj) || SCM_IS_WHVEC_B (obj);
fixup = ptr + j;
alist = *fixup;