summaryrefslogtreecommitdiff
path: root/libguile/weaks.c
diff options
context:
space:
mode:
authorMichael Livshin <mlivshin@bigfoot.com>2000-12-29 22:18:06 +0000
committerMichael Livshin <mlivshin@bigfoot.com>2000-12-29 22:18:06 +0000
commitd9dcd93362ef2956d9d11a46024173c74e197f3c (patch)
treef97d66c4dcccb7d77ea455b7406517bf1911bc4f /libguile/weaks.c
parent174663302558e2eda063dfe185beef860b39deb2 (diff)
downloadguile-d9dcd93362ef2956d9d11a46024173c74e197f3c.tar.gz
* 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'.
Diffstat (limited to 'libguile/weaks.c')
-rw-r--r--libguile/weaks.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libguile/weaks.c b/libguile/weaks.c
index e6d47a376..f0b006a5a 100644
--- a/libguile/weaks.c
+++ b/libguile/weaks.c
@@ -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;