This commit is contained in:
2026-05-19 10:51:22 -06:00
parent c1851fe242
commit 78a4fb402d
5 changed files with 48 additions and 23 deletions

View File

@@ -80,7 +80,18 @@ extern const long scm_tc7_weak_set;
extern const long scm_tc7_symbol;
extern const long scm_tc7_string;
/// Strings
#define SCM_STRINGP(x) (SCM_TYP7 (x) == scm_tc7_string)
size_t scm_c_string_length (SCM str);
const char *scm_c_string_chars (SCM str);
/// Symbols
#define SCM_SYMBOLP(x) (SCM_TYP7 (x) == scm_tc7_symbol)

View File

@@ -92,6 +92,7 @@ find_bucket (scm_t_weak_set *set, unsigned long hash,
&& pred (SCM_PACK (set->entries[p].key), closure)) {
return SCM_PACK (set->entries[p].key);
} else {
/* i have faith in gcc's TCO. */
return find_bucket (set, hash, key, pred, closure,
(p + 1) % set->size);
}
@@ -101,7 +102,7 @@ find_bucket (scm_t_weak_set *set, unsigned long hash,
SCM scm_c_weak_set_insert (SCM set, unsigned long hash,
SCM key, scm_t_set_predicate_fn pred,
void* closure) {
void *closure) {
scm_t_weak_set *s = SCM_WEAK_SET (set);
unsigned long size = s->size;