summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-12 05:47:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-12 05:47:10 +0000
commit96240c6d2d09bb186ebfba2f414348663b806010 (patch)
tree0ed32718f2734e001be72859f38ae82180e88029 /eval_intern.h
parent8c36abe23a9c9e980e398171c860a6756716e124 (diff)
* eval_intern.h (rb_thread_raised_set): use generic flags.
* eval.c (rb_longjmp): clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * gc.c (rb_memerror): use thread raised flag instead of static flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/eval_intern.h b/eval_intern.h
index b5133f0460..0c50331b3e 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -195,16 +195,17 @@ while (0)
void rb_thread_cleanup(void);
void rb_thread_wait_other_threads(void);
-#define RAISED_EXCEPTION 1
-#define RAISED_STACKOVERFLOW 2
+enum {
+ RAISED_EXCEPTION = 1,
+ RAISED_STACKOVERFLOW,
+ RAISED_NOMEMORY,
+};
int rb_thread_set_raised(rb_thread_t *th);
int rb_thread_reset_raised(rb_thread_t *th);
-#define rb_thread_set_stack_overflow(th) \
- ((th)->raised_flag |= RAISED_STACKOVERFLOW)
-#define rb_thread_reset_stack_overflow(th) \
- ((th)->raised_flag &= ~RAISED_STACKOVERFLOW)
-#define rb_thread_stack_overflowing_p(th) \
- (((th)->raised_flag & RAISED_STACKOVERFLOW) != 0)
+#define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f))
+#define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f))
+#define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0)
+#define rb_thread_raised_clear(th) ((th)->raised_flag = 0)
VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
VALUE rb_make_exception(int argc, VALUE *argv);