File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1548,14 +1548,15 @@ assess_work_to_do(GCState *gcstate)
15481548     * This could be improved by tracking survival rates, but it is still a 
15491549     * large improvement on the non-marking approach. 
15501550     */ 
1551-     Py_ssize_t  scale_factor  =  gcstate -> old [0 ].threshold ;
1551+     intptr_t  scale_factor  =  gcstate -> old [0 ].threshold ;
15521552    if  (scale_factor  <  2 ) {
15531553        scale_factor  =  2 ;
15541554    }
1555-     Py_ssize_t  new_objects  =  gcstate -> young .count ;
1556-     Py_ssize_t  heap_fraction  =  gcstate -> heap_size  / SCAN_RATE_DIVISOR  / scale_factor ;
1557-     if  (heap_fraction  >  new_objects * 2 ) {
1558-         heap_fraction  =  new_objects * 2 ;
1555+     intptr_t  new_objects  =  gcstate -> young .count ;
1556+     intptr_t  max_heap_fraction  =  new_objects  *  3 /2 ;
1557+     intptr_t  heap_fraction  =  gcstate -> heap_size  / SCAN_RATE_DIVISOR  / scale_factor ;
1558+     if  (heap_fraction  >  max_heap_fraction ) {
1559+         heap_fraction  =  max_heap_fraction ;
15591560    }
15601561    gcstate -> young .count  =  0 ;
15611562    return  new_objects  +  heap_fraction ;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments