Fix loop to be more accuratly timed, and added custom ruby libs inclusion setup
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "pch.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "binding/ruby_compiled.h"
|
||||
|
||||
#define DEF_SYM(name) inline mrb_sym sym_##name = mrb_intern_cstr(Ruby::mrb, #name);
|
||||
#define SYM(name) mrb_symbol_value(sym_##name)
|
||||
|
||||
@@ -83,7 +85,15 @@ struct Block {
|
||||
};
|
||||
|
||||
inline void run_string(const char *code, size_t length) {
|
||||
int ai = mrb_gc_arena_save(mrb);
|
||||
mrb_load_nstring(mrb, code, length);
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
}
|
||||
|
||||
inline void load_mgems() {
|
||||
int ai = mrb_gc_arena_save(mrb);
|
||||
mrb_load_irep(mrb, mgems);
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
}
|
||||
}; // namespace Ruby
|
||||
|
||||
|
||||
Reference in New Issue
Block a user