summaryrefslogtreecommitdiff
path: root/node.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-02 21:17:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-02 21:17:31 +0000
commita9d25a31ee8d36766163744da57d287a86e1ce18 (patch)
tree94286e01b4207d31e1be0fdebe34e441aa006da7 /node.h
parentbf67d8a89b1bdc40119cdfa5c757bc30c85266a7 (diff)
* eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
if it was frozen. clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * eval.c (rb_thread_set_raised, rb_thread_reset_raised): use generic flags. * eval.c (Init_Proc), gc.c (Init_GC): freeze preallocated special exceptions. * gc.c (rb_memerror): use thread raised flag instead of static flag, and raise nomem_error without backtrace if failed to make backtrace. [ruby-dev:34724] * gc.c (ruby_xmalloc): increase malloc_increase only if malloc succeeds. failed malloc size can be huge. it may increase malloc_limit too big which cause less GC and memory full. (ruby_xrealloc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.h')
-rw-r--r--node.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/node.h b/node.h
index 0c7227eb28..10ab4855c7 100644
--- a/node.h
+++ b/node.h
@@ -468,6 +468,19 @@ extern VALUE (*ruby_sandbox_restore)_((rb_thread_t));
extern rb_thread_t rb_curr_thread;
extern rb_thread_t rb_main_thread;
+enum {
+ RAISED_EXCEPTION = 0x1000,
+ RAISED_STACKOVERFLOW = 0x2000,
+ RAISED_NOMEMORY = 0x4000,
+ RAISED_MASK = 0xf000
+};
+int rb_thread_set_raised(rb_thread_t th);
+int rb_thread_reset_raised(rb_thread_t th);
+#define rb_thread_raised_set(th, f) ((th)->flags |= (f))
+#define rb_thread_raised_reset(th, f) ((th)->flags &= ~(f))
+#define rb_thread_raised_p(th, f) (((th)->flags & (f)) != 0)
+#define rb_thread_raised_clear(th) ((th)->flags = 0)
+
#if defined(__cplusplus)
} /* extern "C" { */
#endif