mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	object_tracing.c: fix allocation from NEWOBJ hook
* ext/objspace/object_tracing.c (newobj_i): use cached class path only to get rid object allocation during NEWOBJ hook. [ruby-core:58853] [Bug #9212] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									b4ab650e1a
								
							
						
					
					
						commit
						d3363a96df
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -81,7 +81,7 @@ newobj_i(VALUE tpval, void *data) | |||
|     VALUE klass = rb_tracearg_defined_class(tparg); | ||||
|     struct allocation_info *info; | ||||
|     const char *path_cstr = RTEST(path) ? make_unique_str(arg->str_table, RSTRING_PTR(path), RSTRING_LEN(path)) : 0; | ||||
|     VALUE class_path = (RTEST(klass) && !OBJ_FROZEN(klass)) ? rb_class_path(klass) : Qnil; | ||||
|     VALUE class_path = (RTEST(klass) && !OBJ_FROZEN(klass)) ? rb_class_path_cached(klass) : Qnil; | ||||
|     const char *class_path_cstr = RTEST(class_path) ? make_unique_str(arg->str_table, RSTRING_PTR(class_path), RSTRING_LEN(class_path)) : 0; | ||||
| 
 | ||||
|     if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu