Skip to content

Avoid exposure for REnv objects#5945

Merged
matz merged 1 commit into
mruby:masterfrom
dearblue:env-internal
Mar 11, 2023
Merged

Avoid exposure for REnv objects#5945
matz merged 1 commit into
mruby:masterfrom
dearblue:env-internal

Conversation

@dearblue

@dearblue dearblue commented Mar 5, 2023

Copy link
Copy Markdown
Contributor

The REnv object is difficult to deal with, and it would be ideal if the user did not have to manipulate it directly. In some previous situations, it was necessary to call mrb_env_unshare(), a non-API function, after mrb_load_string() or similar.

With this patch, it is no longer necessary for users to use mrb_env_unshare() directly, as it is now handled internally simply by using the mrb_vm_ci_env_clear() function. Also, mrb_vm_ci_env_set() is demoted from the MRB_API function for the same reason.

ref. commit 1ab3da6

The `REnv` object is difficult to deal with, and it would be ideal if the user did not have to manipulate it directly.
In some previous situations, it was necessary to call `mrb_env_unshare()`, a non-API function, after `mrb_load_string()` or similar.

With this patch, it is no longer necessary for users to use `mrb_env_unshare()` directly, as it is now handled internally simply by using the `mrb_vm_ci_env_clear()` function.
Also, `mrb_vm_ci_env_set()` is demoted from the `MRB_API` function for the same reason.

ref. commit 1ab3da6
@dearblue dearblue requested a review from matz as a code owner March 5, 2023 09:30
@matz matz merged commit 90e53ca into mruby:master Mar 11, 2023
@matz matz mentioned this pull request Mar 11, 2023
@dearblue dearblue deleted the env-internal branch March 14, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants