summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 09:17:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 09:17:06 +0000
commit9b45b336ee97477b9c8a81143ee47c52d801412b (patch)
treeb40d5a5f32138109f5c9b0006d6d90f6529a621e /vm_core.h
parente7a660a3cfe9a8747b0a5f5b0c88019f5a19bbce (diff)
* vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated special
exceptions. * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze preallocated special exceptions. * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace if it was frozen. * gc.c (rb_memerror): raise nomem_error without backtrace if failed to make backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/vm_core.h b/vm_core.h
index b001491f00..18d1771035 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -281,6 +281,13 @@ struct rb_iseq_struct {
struct iseq_compile_data *compile_data;
};
+enum ruby_special_exceptions {
+ ruby_error_reenter,
+ ruby_error_nomemory,
+ ruby_error_sysstack,
+ ruby_special_error_count
+};
+
typedef struct rb_iseq_struct rb_iseq_t;
#define GetVMPtr(obj, ptr) \
@@ -307,6 +314,8 @@ struct rb_vm_struct
/* object management */
VALUE mark_object_ary;
+ VALUE special_exceptions[ruby_special_error_count];
+
/* load */
VALUE top_self;
VALUE load_path;
@@ -648,7 +657,7 @@ VALUE vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
-RUBY_EXTERN VALUE sysstack_error;
+#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
/* for thread */