126 |
SCM slot; |
SCM slot; |
127 |
|
|
128 |
symbol = scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), |
symbol = scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), |
129 |
(scm_t_bits) scm_must_strndup (name, len), |
(scm_t_bits) scm_gc_strndup (name, len, |
130 |
|
"symbol"), |
131 |
raw_hash, |
raw_hash, |
132 |
SCM_UNPACK (scm_cons (SCM_BOOL_F, |
SCM_UNPACK (scm_cons (SCM_BOOL_F, |
133 |
SCM_EOL))); |
SCM_EOL))); |
147 |
+ SCM_T_BITS_MAX/2 + 1); |
+ SCM_T_BITS_MAX/2 + 1); |
148 |
|
|
149 |
return scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), |
return scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), |
150 |
(scm_t_bits) scm_must_strndup (name, len), |
(scm_t_bits) scm_gc_strndup (name, len, |
151 |
|
"symbol"), |
152 |
raw_hash, |
raw_hash, |
153 |
SCM_UNPACK (scm_cons (SCM_BOOL_F, |
SCM_UNPACK (scm_cons (SCM_BOOL_F, |
154 |
SCM_EOL))); |
SCM_EOL))); |
293 |
SCM_VALIDATE_STRING (1, prefix); |
SCM_VALIDATE_STRING (1, prefix); |
294 |
len = SCM_STRING_LENGTH (prefix); |
len = SCM_STRING_LENGTH (prefix); |
295 |
if (len > MAX_PREFIX_LENGTH) |
if (len > MAX_PREFIX_LENGTH) |
296 |
name = SCM_MUST_MALLOC (len + SCM_INTBUFLEN); |
name = scm_malloc (len + SCM_INTBUFLEN); |
297 |
memcpy (name, SCM_STRING_CHARS (prefix), len); |
memcpy (name, SCM_STRING_CHARS (prefix), len); |
298 |
} |
} |
299 |
{ |
{ |
300 |
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]); |
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]); |
301 |
SCM res = scm_mem2symbol (name, len + n_digits); |
SCM res = scm_mem2symbol (name, len + n_digits); |
302 |
if (name != buf) |
if (name != buf) |
303 |
scm_must_free (name); |
free (name); |
304 |
return res; |
return res; |
305 |
} |
} |
306 |
} |
} |