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

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

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

revision 1.51 by mdj, Wed Feb 19 15:04:50 2003 UTC revision 1.52 by mdj, Wed Feb 19 15:43:00 2003 UTC
# Line 104  SCM weak_hashtables = SCM_EOL; Line 104  SCM weak_hashtables = SCM_EOL;
104  static SCM  static SCM
105  make_hash_table (int flags, unsigned long k, const char *func_name) {  make_hash_table (int flags, unsigned long k, const char *func_name) {
106    SCM table, vector;    SCM table, vector;
107    int i, n = k ? k : 31;    int i = 0, n = k ? k : 31;
108      while (i < HASHTABLE_SIZE_N && n > hashtable_size[i])
109        ++i;
110      n = hashtable_size[i];
111    if (flags)    if (flags)
112      /* The SCM_WVECTF_NOSCAN flag informs the weak vector code not to      /* The SCM_WVECTF_NOSCAN flag informs the weak vector code not to
113         perform the final scan for broken references.  Instead we do         perform the final scan for broken references.  Instead we do
# Line 116  make_hash_table (int flags, unsigned lon Line 119  make_hash_table (int flags, unsigned lon
119    else    else
120      vector = scm_c_make_vector (n, SCM_EOL);      vector = scm_c_make_vector (n, SCM_EOL);
121    scm_t_hashtable *t = scm_gc_malloc (sizeof (*t), s_hashtable);    scm_t_hashtable *t = scm_gc_malloc (sizeof (*t), s_hashtable);
   i = 0;  
   while (i < HASHTABLE_SIZE_N && n > hashtable_size[i])  
     ++i;  
   if (i > 0)  
     i = i - 1;  
122    t->min_size_index = t->size_index = i;    t->min_size_index = t->size_index = i;
123    t->n_items = 0;    t->n_items = 0;
124    t->lower = 0;    t->lower = 0;
125    t->upper = 9 * hashtable_size[i] / 10;    t->upper = 9 * n / 10;
126    t->flags = flags;    t->flags = flags;
127    if (flags)    if (flags)
128      {      {

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

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