add mrb_gv_remove(); untested

parent 9295f6ae
......@@ -53,6 +53,7 @@ mrb_value mrb_mod_constants(mrb_state *mrb, mrb_value mod);
mrb_value mrb_f_global_variables(mrb_state *mrb, mrb_value self);
mrb_value mrb_gv_get(mrb_state *mrb, mrb_sym sym);
void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val);
void mrb_gv_remove(mrb_state *mrb, mrb_sym sym);
mrb_value mrb_obj_instance_variables(mrb_state*, mrb_value);
mrb_value mrb_obj_iv_inspect(mrb_state*, struct RObject*);
mrb_sym mrb_class_sym(mrb_state *mrb, struct RClass *c, struct RClass *outer);
......
......@@ -1031,6 +1031,17 @@ mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value v)
iv_put(mrb, t, sym, v);
}
void
mrb_gv_remove(mrb_state *mrb, mrb_sym sym)
{
iv_tbl *t;
if (!mrb->globals) {
return;
}
iv_del(mrb, mrb->globals, sym, NULL);
}
static int
gv_i(mrb_state *mrb, mrb_sym sym, mrb_value v, void *p)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment