mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
(scm_mem2symbol): Re-introduce indirect cell. It is
needed for weak-key hashtables.
This commit is contained in:
parent
311b6a3cb1
commit
a7a59ea9d0
1 changed files with 4 additions and 2 deletions
|
@ -99,7 +99,7 @@ scm_mem2symbol (const char *name, scm_sizet len)
|
|||
|
||||
for (l = SCM_VELTS (symbols) [hash]; !SCM_NULLP (l); l = SCM_CDR (l))
|
||||
{
|
||||
SCM sym = SCM_CAR (l);
|
||||
SCM sym = SCM_CAAR (l);
|
||||
if (SCM_SYMBOL_HASH (sym) == raw_hash
|
||||
&& SCM_SYMBOL_LENGTH (sym) == len)
|
||||
{
|
||||
|
@ -124,6 +124,7 @@ scm_mem2symbol (const char *name, scm_sizet len)
|
|||
/* The symbol was not found - create it. */
|
||||
|
||||
SCM symbol;
|
||||
SCM cell;
|
||||
SCM slot;
|
||||
|
||||
SCM_NEWCELL2 (symbol);
|
||||
|
@ -133,7 +134,8 @@ scm_mem2symbol (const char *name, scm_sizet len)
|
|||
SCM_SET_SYMBOL_LENGTH (symbol, (long) len);
|
||||
|
||||
slot = SCM_VELTS (symbols) [hash];
|
||||
SCM_VELTS (symbols) [hash] = scm_cons (symbol, slot);
|
||||
cell = scm_cons (symbol, SCM_UNDEFINED);
|
||||
SCM_VELTS (symbols) [hash] = scm_cons (cell, slot);
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue