ruby-changes:13968
From: nobu <ko1@a...>
Date: Mon, 16 Nov 2009 01:05:40 +0900 (JST)
Subject: [ruby-changes:13968] Ruby:r25775 (mvm): * include/ruby/public_object.h (ruby_public_object_vmkey): moved
nobu 2009-11-16 01:04:34 +0900 (Mon, 16 Nov 2009) New Revision: 25775 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25775 Log: * include/ruby/public_object.h (ruby_public_object_vmkey): moved rb_fs, rb_output_fs, rb_rs, rb_default_rs, rb_output_rs to VM specific. Index: array.c =================================================================== --- array.c (revision 25770) +++ array.c (working copy) @@ -1513,6 +1513,4 @@ rb_ary_resurrect(VALUE ary) } -extern VALUE rb_output_fs; - static void ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result); Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 25770) +++ include/ruby/intern.h (working copy) @@ -402,9 +402,4 @@ VALUE rb_env_clear(void); /* io.c */ #define rb_defout rb_stdout -RUBY_EXTERN VALUE rb_fs; -RUBY_EXTERN VALUE rb_output_fs; -RUBY_EXTERN VALUE rb_rs; -RUBY_EXTERN VALUE rb_default_rs; -RUBY_EXTERN VALUE rb_output_rs; VALUE rb_io_write(VALUE, VALUE); VALUE rb_io_gets(VALUE); Index: include/ruby/public_object.h =================================================================== --- include/ruby/public_object.h (revision 25770) +++ include/ruby/public_object.h (working copy) @@ -188,4 +188,15 @@ enum ruby_public_object_vmkey { #define ruby_progname (*rb_vm_specific_ptr(rb_vmkey_progname)) + rb_vmkey_fs, +#define rb_fs (*rb_vm_specific_ptr(rb_vmkey_fs)) + rb_vmkey_output_fs, +#define rb_output_fs (*rb_vm_specific_ptr(rb_vmkey_output_fs)) + rb_vmkey_rs, +#define rb_rs (*rb_vm_specific_ptr(rb_vmkey_rs)) + rb_vmkey_output_rs, +#define rb_output_rs (*rb_vm_specific_ptr(rb_vmkey_output_rs)) + rb_vmkey_default_rs, +#define rb_default_rs (*rb_vm_specific_ptr(rb_vmkey_default_rs)) + ruby_public_object_count }; Index: io.c =================================================================== --- io.c (revision 25770) +++ io.c (working copy) @@ -113,11 +113,6 @@ extern void InitVM_File(void); #define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) -VALUE rb_deferr; /* rescue VIM plugin */ -static VALUE orig_stdout, orig_stderr; - -VALUE rb_output_fs; -VALUE rb_rs; -VALUE rb_output_rs; -VALUE rb_default_rs; +#define orig_stdout (*rb_vm_specific_ptr(rb_vmkey_orig_stdout)) +#define orig_stderr (*rb_vm_specific_ptr(rb_vmkey_orig_stderr)) static ID id_write, id_read, id_getc, id_flush, id_readpartial; @@ -9986,5 +9981,5 @@ InitVM_IO(void) rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter); orig_stdout = rb_stdout; - rb_deferr = orig_stderr = rb_stderr; + orig_stderr = rb_stderr; /* constants to hold original stdin/stdout/stderr */ Index: private_object.h =================================================================== --- private_object.h (revision 25770) +++ private_object.h (working copy) @@ -67,4 +67,7 @@ enum ruby_private_object_vmkey { rb_vmkey_default_rand, + rb_vmkey_orig_stdout, + rb_vmkey_orig_stderr, + ruby_builtin_object_count, ruby_private_object_count = ruby_builtin_object_count - ruby_private_object_vmkey_begin + 1 Index: string.c =================================================================== --- string.c (revision 25770) +++ string.c (working copy) @@ -133,6 +133,4 @@ single_byte_optimizable(VALUE str) } -VALUE rb_fs; - static inline const char * search_nonascii(const char *p, const char *e) Modified files: branches/mvm/ChangeLog branches/mvm/array.c branches/mvm/include/ruby/intern.h branches/mvm/include/ruby/public_object.h branches/mvm/io.c branches/mvm/private_object.h branches/mvm/string.c Index: mvm/array.c =================================================================== --- mvm/array.c (revision 25774) +++ mvm/array.c (revision 25775) @@ -1512,8 +1512,6 @@ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_PTR(ary)); } -extern VALUE rb_output_fs; - static void ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result); static VALUE Index: mvm/include/ruby/intern.h =================================================================== --- mvm/include/ruby/intern.h (revision 25774) +++ mvm/include/ruby/intern.h (revision 25775) @@ -401,11 +401,6 @@ VALUE rb_env_clear(void); /* io.c */ #define rb_defout rb_stdout -RUBY_EXTERN VALUE rb_fs; -RUBY_EXTERN VALUE rb_output_fs; -RUBY_EXTERN VALUE rb_rs; -RUBY_EXTERN VALUE rb_default_rs; -RUBY_EXTERN VALUE rb_output_rs; VALUE rb_io_write(VALUE, VALUE); VALUE rb_io_gets(VALUE); VALUE rb_io_getbyte(VALUE); Index: mvm/include/ruby/public_object.h =================================================================== --- mvm/include/ruby/public_object.h (revision 25774) +++ mvm/include/ruby/public_object.h (revision 25775) @@ -187,6 +187,17 @@ rb_vmkey_progname, #define ruby_progname (*rb_vm_specific_ptr(rb_vmkey_progname)) + rb_vmkey_fs, +#define rb_fs (*rb_vm_specific_ptr(rb_vmkey_fs)) + rb_vmkey_output_fs, +#define rb_output_fs (*rb_vm_specific_ptr(rb_vmkey_output_fs)) + rb_vmkey_rs, +#define rb_rs (*rb_vm_specific_ptr(rb_vmkey_rs)) + rb_vmkey_output_rs, +#define rb_output_rs (*rb_vm_specific_ptr(rb_vmkey_output_rs)) + rb_vmkey_default_rs, +#define rb_default_rs (*rb_vm_specific_ptr(rb_vmkey_default_rs)) + ruby_public_object_count }; Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 25774) +++ mvm/ChangeLog (revision 25775) @@ -1,5 +1,9 @@ -Mon Nov 16 01:02:45 2009 Nobuyoshi Nakada <nobu@r...> +Mon Nov 16 01:04:25 2009 Nobuyoshi Nakada <nobu@r...> + * include/ruby/public_object.h (ruby_public_object_vmkey): moved + rb_fs, rb_output_fs, rb_rs, rb_default_rs, rb_output_rs to VM + specific. + * common.mk (RUBY_H_INCLUDES): include private_object.h. Sun Nov 15 07:01:13 2009 Nobuyoshi Nakada <nobu@r...> Index: mvm/string.c =================================================================== --- mvm/string.c (revision 25774) +++ mvm/string.c (revision 25775) @@ -132,8 +132,6 @@ return 0; } -VALUE rb_fs; - static inline const char * search_nonascii(const char *p, const char *e) { Index: mvm/io.c =================================================================== --- mvm/io.c (revision 25774) +++ mvm/io.c (revision 25775) @@ -112,14 +112,9 @@ #define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) -VALUE rb_deferr; /* rescue VIM plugin */ -static VALUE orig_stdout, orig_stderr; +#define orig_stdout (*rb_vm_specific_ptr(rb_vmkey_orig_stdout)) +#define orig_stderr (*rb_vm_specific_ptr(rb_vmkey_orig_stderr)) -VALUE rb_output_fs; -VALUE rb_rs; -VALUE rb_output_rs; -VALUE rb_default_rs; - static ID id_write, id_read, id_getc, id_flush, id_readpartial; static VALUE sym_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args; static VALUE sym_textmode, sym_binmode; @@ -9985,7 +9980,7 @@ rb_stderr = prep_stdio(stderr, FMODE_WRITABLE|FMODE_SYNC, rb_cIO, "<STDERR>"); rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter); orig_stdout = rb_stdout; - rb_deferr = orig_stderr = rb_stderr; + orig_stderr = rb_stderr; /* constants to hold original stdin/stdout/stderr */ rb_define_global_const("STDIN", rb_stdin); Index: mvm/private_object.h =================================================================== --- mvm/private_object.h (revision 25774) +++ mvm/private_object.h (revision 25775) @@ -66,6 +66,9 @@ rb_vmkey_default_rand, + rb_vmkey_orig_stdout, + rb_vmkey_orig_stderr, + ruby_builtin_object_count, ruby_private_object_count = ruby_builtin_object_count - ruby_private_object_vmkey_begin + 1 }; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/