Add basic app interface

- Add pool struct for data pools
This commit is contained in:
2026-05-04 15:49:54 +01:00
parent 9e85763f9e
commit 55f4b4d933
9 changed files with 334 additions and 113 deletions
+14 -1
View File
@@ -7,7 +7,20 @@ struct Block {
mrb_value proc;
Block(mrb_value proc) : proc(proc) {
mrb_gc_protect(mrb, proc);
mrb_gc_register(mrb, proc);
}
Block() : proc(mrb_nil_value()) {}
Block(const Block &) = delete;
Block &operator=(const Block &) = delete;
mrb_value call(int argc = 0, mrb_value *argv = nullptr) const {
return mrb_funcall(mrb, proc, "call", argc, argv);
}
~Block() {
mrb_gc_unregister(mrb, proc);
}
};
}; // namespace Ruby