mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* string.c (STR_HEAP_SIZE): includes TERM_LEN(str).
* string.c (rb_str_memsize): use STR_HEAP_SIZE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									f8e0e1647e
								
							
						
					
					
						commit
						cf0106827d
					
				
					 2 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
Thu Oct 17 18:45:41 2013  Koichi Sasada  <ko1@atdot.net>
 | 
			
		||||
 | 
			
		||||
	* string.c (STR_HEAP_SIZE): includes TERM_LEN(str).
 | 
			
		||||
 | 
			
		||||
	* string.c (rb_str_memsize): use STR_HEAP_SIZE().
 | 
			
		||||
 | 
			
		||||
Thu Oct 17 17:43:00 2013  Shugo Maeda  <shugo@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* vm_insnhelper.c (vm_call_method): set ci->me to 0 when the
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								string.c
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								string.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -127,7 +127,7 @@ VALUE rb_cSymbol;
 | 
			
		|||
} while (0)
 | 
			
		||||
 | 
			
		||||
#define STR_HEAP_PTR(str)  (RSTRING(str)->as.heap.ptr)
 | 
			
		||||
#define STR_HEAP_SIZE(str) (RSTRING(str)->as.heap.aux.capa)
 | 
			
		||||
#define STR_HEAP_SIZE(str) (RSTRING(str)->as.heap.aux.capa + TERM_LEN(str))
 | 
			
		||||
 | 
			
		||||
#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
 | 
			
		||||
#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
 | 
			
		||||
| 
						 | 
				
			
			@ -891,7 +891,7 @@ RUBY_FUNC_EXPORTED size_t
 | 
			
		|||
rb_str_memsize(VALUE str)
 | 
			
		||||
{
 | 
			
		||||
    if (!STR_EMBED_P(str) && !STR_SHARED_P(str)) {
 | 
			
		||||
	return RSTRING(str)->as.heap.aux.capa;
 | 
			
		||||
	return STR_HEAP_SIZE(str);
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue