From 2cf6badbcae161d2ab27c73efce5e425f1198e48 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 10 Dec 2007 08:46:06 +0000 Subject: * string.c (rb_str_tmp_new): creates hidden temporary buffer. * transcode.c (transcoding): added a pointer to function to flush. * transcode.c (transcode_loop): do not use string internal. [ruby-dev:32512] * transcode.c (str_transcode): allow Encoding objects. * transcode_data.h (BYTE_LOOKUP): use actual struct name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 9eba3b884..9408b9824 100644 --- a/string.c +++ b/string.c @@ -179,7 +179,7 @@ str_alloc(VALUE klass) return (VALUE)str; } -VALUE +static VALUE str_new(VALUE klass, const char *ptr, long len) { VALUE str; @@ -370,6 +370,12 @@ rb_str_buf_new2(const char *ptr) return str; } +VALUE +rb_str_tmp_new(long len) +{ + return str_new(0, 0, len); +} + void rb_str_free(VALUE str) { @@ -384,7 +390,7 @@ rb_str_to_str(VALUE str) return rb_convert_type(str, T_STRING, "String", "to_str"); } -static void +void rb_str_shared_replace(VALUE str, VALUE str2) { if (str == str2) return; @@ -625,7 +631,7 @@ str_modifiable(VALUE str) rb_raise(rb_eSecurityError, "Insecure: can't modify string"); } -int +static int str_independent(VALUE str) { str_modifiable(str); -- cgit