mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* test/dl/test_callback.rb (test_callback_with_string): prevents
temporary string from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									13d3a16ada
								
							
						
					
					
						commit
						527be1b25a
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		|  | @ -1,3 +1,8 @@ | ||||||
|  | Tue Aug 30 22:34:45 2011  CHIKANAGA Tomoyuki  <nagachika00@gmail.com> | ||||||
|  | 
 | ||||||
|  | 	* test/dl/test_callback.rb (test_callback_with_string): prevents | ||||||
|  | 	  temporary string from GC. | ||||||
|  | 
 | ||||||
| Tue Aug 30 22:25:38 2011  NAKAMURA Usaku  <usa@ruby-lang.org> | Tue Aug 30 22:25:38 2011  NAKAMURA Usaku  <usa@ruby-lang.org> | ||||||
| 
 | 
 | ||||||
| 	* vm_insnhelper.c (vm_call_cfunc): revert r33112.  RB_GC_GUARD macro | 	* vm_insnhelper.c (vm_call_cfunc): revert r33112.  RB_GC_GUARD macro | ||||||
|  |  | ||||||
|  | @ -48,8 +48,11 @@ module DL | ||||||
|       func = CFunc.new(addr, TYPE_VOID, 'test') |       func = CFunc.new(addr, TYPE_VOID, 'test') | ||||||
|       f = Function.new(func, [TYPE_VOIDP]) |       f = Function.new(func, [TYPE_VOIDP]) | ||||||
| 
 | 
 | ||||||
|       f.call(dlwrap('foo')) |       # Don't remove local variable arg. | ||||||
|       assert_equal 'foo', called_with |       # This necessary to protect objects from GC. | ||||||
|  |       arg = 'foo' | ||||||
|  |       f.call(dlwrap(arg)) | ||||||
|  |       assert_equal arg, called_with | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     def test_call_callback |     def test_call_callback | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nagachika
						nagachika