218 |
|
|
219 |
#define PERCENT_FREE(tm) ((tm->tm_percent_free ? tm->tm_percent_free : 10)/100.0) |
#define PERCENT_FREE(tm) ((tm->tm_percent_free ? tm->tm_percent_free : 10)/100.0) |
220 |
|
|
221 |
|
static int |
222 |
|
grow_linear(int old, int fract, int grow_min, int grow_max) { |
223 |
|
|
224 |
|
int delt; |
225 |
|
if (fract==0) |
226 |
|
fract=50; |
227 |
|
if (grow_min==0) |
228 |
|
grow_min=1; |
229 |
|
if (grow_max==0) |
230 |
|
grow_max=1000; |
231 |
|
|
232 |
|
delt=(old*fract)/100; |
233 |
|
delt= (delt < grow_min ? grow_min: |
234 |
|
delt > grow_max ? grow_max: |
235 |
|
delt); |
236 |
|
|
237 |
|
return old + delt; |
238 |
|
|
239 |
|
} |
240 |
|
|
241 |
|
|
242 |
object |
object |
243 |
alloc_object(enum type t) |
alloc_object(enum type t) |
311 |
goto ONCE_MORE; |
goto ONCE_MORE; |
312 |
} |
} |
313 |
|
|
|
static int |
|
|
grow_linear(int old, int fract, int grow_min, int grow_max) { |
|
|
|
|
|
int delt; |
|
|
if (fract==0) |
|
|
fract=50; |
|
|
if (grow_min==0) |
|
|
grow_min=1; |
|
|
if (grow_max==0) |
|
|
grow_max=1000; |
|
|
|
|
|
delt=(old*fract)/100; |
|
|
delt= (delt < grow_min ? grow_min: |
|
|
delt > grow_max ? grow_max: |
|
|
delt); |
|
|
|
|
|
return old + delt; |
|
|
|
|
|
} |
|
|
|
|
314 |
object |
object |
315 |
make_cons(object a, object d) |
make_cons(object a, object d) |
316 |
{ |
{ |