Merge pull request #5415 from dearblue/unwind-mrb_protect

Introducing the `mrb_protect_raw()` API function
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-04-19 22:34:20 +09:00
committed by GitHub
4 changed files with 82 additions and 65 deletions
+8
View File
@@ -133,6 +133,14 @@ MRB_API mrb_value mrb_rescue_exceptions(mrb_state *mrb, mrb_func_t body, mrb_val
mrb_func_t rescue, mrb_value r_data,
mrb_int len, struct RClass **classes);
typedef mrb_value mrb_protect_raw_func(mrb_state *mrb, void *userdata);
/**
* This API function behaves like `mrb_protect()`.
* The advantage is that it avoids objectifying the user data.
*/
MRB_API mrb_value mrb_protect_raw(mrb_state *mrb, mrb_protect_raw_func *body, void *userdata, mrb_bool *error);
MRB_END_DECL
#endif /* MRUBY_ERROR_H */