469 |
abort (); |
abort (); |
470 |
} |
} |
471 |
|
|
|
|
|
|
/* Pick a size for the new heap segment. |
|
|
* The rule for picking the size of a segment is explained in |
|
|
* gc.h |
|
|
*/ |
|
472 |
{ |
{ |
473 |
/* Assure that the new segment is predicted to be large enough. |
/* Assure that the new segment is predicted to be large enough. |
474 |
* |
* |
483 |
* |
* |
484 |
* This gives dh > (f * h - y) / (1 - f) |
* This gives dh > (f * h - y) / (1 - f) |
485 |
*/ |
*/ |
486 |
|
float f = freelist->min_yield_fraction / 100.0; |
487 |
/* |
float h = SCM_HEAP_SIZE; |
488 |
where is is this explanation supposed to be? --hwn |
float min_cells |
489 |
*/ |
= (f * h - scm_gc_cells_collected) / (1.0 - f); |
|
int f = freelist->min_yield_fraction; |
|
|
unsigned long h = SCM_HEAP_SIZE; |
|
|
size_t min_cells = (f * h - 100 * (long) scm_gc_cells_collected) / (99 - f); |
|
490 |
|
|
491 |
/* Make heap grow with factor 1.5 */ |
/* Make heap grow with factor 1.5 */ |
492 |
len = freelist->heap_size / 2; |
len = freelist->heap_size / 2; |
494 |
fprintf (stderr, "(%ld < %ld)", (long) len, (long) min_cells); |
fprintf (stderr, "(%ld < %ld)", (long) len, (long) min_cells); |
495 |
#endif |
#endif |
496 |
|
|
|
/* |
|
|
Original code adds freelist->cluster_size here. |
|
|
*/ |
|
497 |
if (len < min_cells) |
if (len < min_cells) |
498 |
len = min_cells; |
len = (unsigned long) min_cells; |
499 |
len *= sizeof (scm_t_cell); |
len *= sizeof (scm_t_cell); |
500 |
/* force new sampling */ |
/* force new sampling */ |
501 |
freelist->collected = LONG_MAX; |
freelist->collected = LONG_MAX; |