mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5415 from dearblue/unwind-mrb_protect
Introducing the `mrb_protect_raw()` API function
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user