/[guile]/guile/guile-core/libguile/symbols.c
ViewVC logotype

Diff of /guile/guile-core/libguile/symbols.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.99 by mvo, Mon Feb 4 16:47:35 2002 UTC revision 1.100 by mvo, Mon Feb 11 18:06:49 2002 UTC
# Line 126  scm_mem2symbol (const char *name, size_t Line 126  scm_mem2symbol (const char *name, size_t
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)));
# Line 146  scm_mem2uninterned_symbol (const char *n Line 147  scm_mem2uninterned_symbol (const char *n
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)));
# Line 291  SCM_DEFINE (scm_gensym, "gensym", 0, 1, Line 293  SCM_DEFINE (scm_gensym, "gensym", 0, 1,
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  }  }

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26