/[guile]/guile/guile-core/libguile/gc-segment.c
ViewVC logotype

Diff of /guile/guile-core/libguile/gc-segment.c

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

revision 1.6 by hanwen, Fri Aug 23 00:05:58 2002 UTC revision 1.7 by hanwen, Sun Aug 25 15:26:14 2002 UTC
# Line 469  scm_i_get_new_heap_segment (scm_t_cell_t Line 469  scm_i_get_new_heap_segment (scm_t_cell_t
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       *       *
# Line 488  scm_i_get_new_heap_segment (scm_t_cell_t Line 483  scm_i_get_new_heap_segment (scm_t_cell_t
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;
# Line 502  scm_i_get_new_heap_segment (scm_t_cell_t Line 494  scm_i_get_new_heap_segment (scm_t_cell_t
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;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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