Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 2260:f913c1545598
[xemacs-hg @ 2004-09-10 18:46:58 by james]
Change log to log2 to avoid gcc3 shadow warnings.
author | james |
---|---|
date | Fri, 10 Sep 2004 18:47:02 +0000 |
parents | 9c872f33ecbe |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
2259:e77c2aea9fd8 | 2260:f913c1545598 |
---|---|
5141 if (claimed_size < 16) | 5141 if (claimed_size < 16) |
5142 claimed_size = 16; | 5142 claimed_size = 16; |
5143 # endif | 5143 # endif |
5144 if (claimed_size < 4096) | 5144 if (claimed_size < 4096) |
5145 { | 5145 { |
5146 int log = 1; | 5146 /* fxg: rename log->log2 to supress gcc3 shadow warning */ |
5147 int log2 = 1; | |
5147 | 5148 |
5148 /* compute the log base two, more or less, then use it to compute | 5149 /* compute the log base two, more or less, then use it to compute |
5149 the block size needed. */ | 5150 the block size needed. */ |
5150 claimed_size--; | 5151 claimed_size--; |
5151 /* It's big, it's heavy, it's wood! */ | 5152 /* It's big, it's heavy, it's wood! */ |
5152 while ((claimed_size /= 2) != 0) | 5153 while ((claimed_size /= 2) != 0) |
5153 ++log; | 5154 ++log2; |
5154 claimed_size = 1; | 5155 claimed_size = 1; |
5155 /* It's better than bad, it's good! */ | 5156 /* It's better than bad, it's good! */ |
5156 while (log > 0) | 5157 while (log2 > 0) |
5157 { | 5158 { |
5158 claimed_size *= 2; | 5159 claimed_size *= 2; |
5159 log--; | 5160 log2--; |
5160 } | 5161 } |
5161 /* We have to come up with some average about the amount of | 5162 /* We have to come up with some average about the amount of |
5162 blocks used. */ | 5163 blocks used. */ |
5163 if ((Bytecount) (rand () & 4095) < claimed_size) | 5164 if ((Bytecount) (rand () & 4095) < claimed_size) |
5164 claimed_size += 3 * sizeof (void *); | 5165 claimed_size += 3 * sizeof (void *); |
5182 claimed_size += 20; | 5183 claimed_size += 20; |
5183 # else | 5184 # else |
5184 claimed_size += 8; | 5185 claimed_size += 8; |
5185 # endif | 5186 # endif |
5186 { | 5187 { |
5187 int log = 1; | 5188 /* fxg: rename log->log2 to supress gcc3 shadow warning */ |
5189 int log2 = 1; | |
5188 | 5190 |
5189 /* compute the log base two, more or less, then use it to compute | 5191 /* compute the log base two, more or less, then use it to compute |
5190 the block size needed. */ | 5192 the block size needed. */ |
5191 claimed_size--; | 5193 claimed_size--; |
5192 /* It's big, it's heavy, it's wood! */ | 5194 /* It's big, it's heavy, it's wood! */ |
5193 while ((claimed_size /= 2) != 0) | 5195 while ((claimed_size /= 2) != 0) |
5194 ++log; | 5196 ++log2; |
5195 claimed_size = 1; | 5197 claimed_size = 1; |
5196 /* It's better than bad, it's good! */ | 5198 /* It's better than bad, it's good! */ |
5197 while (log > 0) | 5199 while (log2 > 0) |
5198 { | 5200 { |
5199 claimed_size *= 2; | 5201 claimed_size *= 2; |
5200 log--; | 5202 log2--; |
5201 } | 5203 } |
5202 } | 5204 } |
5203 | 5205 |
5204 #endif /* old GNU allocator */ | 5206 #endif /* old GNU allocator */ |
5205 | 5207 |