зеркало из https://github.com/github/ruby.git
* vm_core.h (struct rb_vm_struct): moved ruby_debug, ruby_verbose, and
rb_progname. * ruby.c (rb_argv0): no longer used. * vm.c: getters/setters for ruby_{debug,verbose}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9fb521515d
Коммит
6cdc89332e
|
@ -1,6 +1,9 @@
|
|||
Mon Jun 9 13:20:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Mon Jun 9 14:18:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_core.h (struct rb_vm_struct): moved src_encoding_index.
|
||||
* vm_core.h (struct rb_vm_struct): moved src_encoding_index,
|
||||
ruby_debug, ruby_verbose, and rb_progname.
|
||||
|
||||
* ruby.c (rb_argv0): no longer used.
|
||||
|
||||
* ruby.c (struct cmdline_options): moved setids and req_list, and the
|
||||
latter is now an array, to prevent memory leak.
|
||||
|
@ -12,6 +15,8 @@ Mon Jun 9 13:20:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||
|
||||
* vm.c (vm_init2): initialize src_encoding_index.
|
||||
|
||||
* vm.c: getters/setters for ruby_{debug,verbose}.
|
||||
|
||||
Mon Jun 9 09:54:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/intern.h (Init_stack): make to call ruby_init_stack.
|
||||
|
|
|
@ -15,4 +15,7 @@
|
|||
typedef struct rb_vm_struct rb_vm_t;
|
||||
typedef struct rb_thread_struct rb_thread_t;
|
||||
|
||||
VALUE *ruby_vm_verbose_ptr(rb_vm_t *);
|
||||
VALUE *ruby_vm_debug_ptr(rb_vm_t *);
|
||||
|
||||
#endif /* RUBY_MVM_H */
|
||||
|
|
|
@ -799,7 +799,10 @@ VALUE rb_iv_set(VALUE, const char*, VALUE);
|
|||
|
||||
VALUE rb_equal(VALUE,VALUE);
|
||||
|
||||
RUBY_EXTERN VALUE ruby_verbose, ruby_debug;
|
||||
VALUE *rb_ruby_verbose_ptr(void);
|
||||
VALUE *rb_ruby_debug_ptr(void);
|
||||
#define ruby_verbose (*rb_ruby_verbose_ptr())
|
||||
#define ruby_debug (*rb_ruby_debug_ptr())
|
||||
|
||||
PRINTF_ARGS(NORETURN(void rb_raise(VALUE, const char*, ...)), 2, 3);
|
||||
PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2);
|
||||
|
|
8
ruby.c
8
ruby.c
|
@ -57,9 +57,6 @@
|
|||
char *getenv();
|
||||
#endif
|
||||
|
||||
/* TODO: move to VM */
|
||||
VALUE ruby_debug = Qfalse;
|
||||
VALUE ruby_verbose = Qfalse;
|
||||
VALUE rb_parser_get_yydebug(VALUE);
|
||||
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
||||
|
||||
|
@ -956,8 +953,7 @@ opt_enc_index(VALUE enc_name)
|
|||
return i;
|
||||
}
|
||||
|
||||
VALUE rb_progname;
|
||||
VALUE rb_argv0;
|
||||
#define rb_progname (GET_VM()->progname)
|
||||
|
||||
static VALUE
|
||||
process_options(VALUE arg)
|
||||
|
@ -1473,7 +1469,6 @@ ruby_prog_init(void)
|
|||
rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
|
||||
|
||||
rb_define_global_const("ARGV", rb_argv);
|
||||
rb_global_variable(&rb_argv0);
|
||||
|
||||
#ifdef MSDOS
|
||||
/*
|
||||
|
@ -1529,7 +1524,6 @@ ruby_process_options(int argc, char **argv)
|
|||
NODE *tree;
|
||||
|
||||
ruby_script(argv[0]); /* for the time being */
|
||||
rb_argv0 = rb_progname;
|
||||
args.argc = argc;
|
||||
args.argv = argv;
|
||||
args.opt = cmdline_options_init(&opt);
|
||||
|
|
23
vm.c
23
vm.c
|
@ -1777,3 +1777,26 @@ Init_top_self(void)
|
|||
vm->top_self = rb_obj_alloc(rb_cObject);
|
||||
rb_define_singleton_method(rb_vm_top_self(), "to_s", main_to_s, 0);
|
||||
}
|
||||
|
||||
VALUE *
|
||||
ruby_vm_verbose_ptr(rb_vm_t *vm)
|
||||
{
|
||||
return &vm->verbose;
|
||||
}
|
||||
|
||||
VALUE *
|
||||
ruby_vm_debug_ptr(rb_vm_t *vm)
|
||||
{
|
||||
return &vm->debug;
|
||||
}
|
||||
|
||||
VALUE *
|
||||
rb_ruby_verbose_ptr(void)
|
||||
{
|
||||
return ruby_vm_verbose_ptr(GET_VM());
|
||||
}
|
||||
|
||||
VALUE *rb_ruby_debug_ptr(void)
|
||||
{
|
||||
return ruby_vm_debug_ptr(GET_VM());
|
||||
}
|
||||
|
|
|
@ -321,6 +321,8 @@ struct rb_vm_struct
|
|||
|
||||
int src_encoding_index;
|
||||
|
||||
VALUE verbose, debug, progname;
|
||||
|
||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||
struct rb_objspace *objspace;
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче