diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-19 22:34:20 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-19 22:34:20 +0900 |
| commit | ff366b65ebc866a6287002ece5121f6f25321e26 (patch) | |
| tree | e754c81cdf798dc2b8ead74192154bc30a918e9f /include | |
| parent | 9d362f2c2732b15341f76d2d51bbd946b28e5974 (diff) | |
| parent | 891e852286dabdc2dfda70b00d5325546a939a62 (diff) | |
| download | mruby-ff366b65ebc866a6287002ece5121f6f25321e26.tar.gz mruby-ff366b65ebc866a6287002ece5121f6f25321e26.zip | |
Merge pull request #5415 from dearblue/unwind-mrb_protect
Introducing the `mrb_protect_raw()` API function
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/error.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mruby/error.h b/include/mruby/error.h index 9ebc0d335..a715eb0b6 100644 --- a/include/mruby/error.h +++ b/include/mruby/error.h @@ -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 */ |
