mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	
							parent
							
								
									2ef6673708
								
							
						
					
					
						commit
						f1a52d96a5
					
				
					 3 changed files with 15 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								gc.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								gc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2571,6 +2571,8 @@ Init_heap(void)
 | 
			
		|||
    objspace->id_to_obj_tbl = st_init_numtable();
 | 
			
		||||
    objspace->obj_to_id_tbl = st_init_numtable();
 | 
			
		||||
 | 
			
		||||
    dont_gc = 1;
 | 
			
		||||
 | 
			
		||||
    gc_stress_set(objspace, ruby_initial_gc_stress);
 | 
			
		||||
 | 
			
		||||
#if RGENGC_ESTIMATE_OLDMALLOC
 | 
			
		||||
| 
						 | 
				
			
			@ -2584,6 +2586,14 @@ Init_heap(void)
 | 
			
		|||
    finalizer_table = st_init_numtable();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
Init_gc_stress(void)
 | 
			
		||||
{
 | 
			
		||||
    rb_objspace_t *objspace = &rb_objspace;
 | 
			
		||||
 | 
			
		||||
    dont_gc = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
typedef int each_obj_callback(void *, void *, size_t, void *);
 | 
			
		||||
 | 
			
		||||
struct each_obj_args {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								inits.c
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								inits.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -67,5 +67,6 @@ rb_call_inits(void)
 | 
			
		|||
    CALL(vm_trace);
 | 
			
		||||
    CALL(vm_stack_canary);
 | 
			
		||||
    CALL(ast);
 | 
			
		||||
    CALL(gc_stress);
 | 
			
		||||
}
 | 
			
		||||
#undef CALL
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -384,6 +384,10 @@ class TestGc < Test::Unit::TestCase
 | 
			
		|||
    end;
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_gc_stress_at_startup
 | 
			
		||||
    assert_in_out_err([{"RUBY_DEBUG"=>"gc_stress"}], '', [], [], '[Bug #15784]', success: true)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_gc_disabled_start
 | 
			
		||||
    begin
 | 
			
		||||
      disabled = GC.disable
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue