comparison src/xgccache.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
91 int delete_count; 91 int delete_count;
92 }; 92 };
93 93
94 #ifdef GCCACHE_HASH 94 #ifdef GCCACHE_HASH
95 static unsigned long 95 static unsigned long
96 gc_cache_hash (CONST void *arg) 96 gc_cache_hash (const void *arg)
97 { 97 {
98 CONST struct gcv_and_mask *gcvm = (CONST struct gcv_and_mask *) arg; 98 const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg;
99 unsigned long *longs = (unsigned long *) &gcvm->gcv; 99 unsigned long *longs = (unsigned long *) &gcvm->gcv;
100 unsigned long hash = gcvm->mask; 100 unsigned long hash = gcvm->mask;
101 int i; 101 int i;
102 /* This could look at the mask and only use the used slots in the 102 /* This could look at the mask and only use the used slots in the
103 hash code. That would win in that we wouldn't have to initialize 103 hash code. That would win in that we wouldn't have to initialize
110 } 110 }
111 111
112 #endif /* GCCACHE_HASH */ 112 #endif /* GCCACHE_HASH */
113 113
114 static int 114 static int
115 gc_cache_eql (CONST void *arg1, CONST void *arg2) 115 gc_cache_eql (const void *arg1, const void *arg2)
116 { 116 {
117 /* See comment in gc_cache_hash */ 117 /* See comment in gc_cache_hash */
118 return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask)); 118 return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
119 } 119 }
120 120
164 gcvm.mask = mask; 164 gcvm.mask = mask;
165 gcvm.gcv = *gcv; /* this copies... */ 165 gcvm.gcv = *gcv; /* this copies... */
166 166
167 #ifdef GCCACHE_HASH 167 #ifdef GCCACHE_HASH
168 168
169 if (gethash (&gcvm, cache->table, (CONST void **) &cell)) 169 if (gethash (&gcvm, cache->table, (const void **) &cell))
170 170
171 #else /* !GCCACHE_HASH */ 171 #else /* !GCCACHE_HASH */
172 172
173 cell = cache->tail; /* start at the end (most recently used) */ 173 cell = cache->tail; /* start at the end (most recently used) */
174 while (cell) 174 while (cell)