From 8f2c62407c0659d84126545e19505a851059e750 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 20 Nov 2017 06:21:22 +0900 Subject: Add `MRB_METHOD_TABLE_INLINE` option. Now the method tables (in classes/modules and caches) keeps C function pointers without wrapping in `struct RProc` objects. For the sake of portability, `mrb_method_t` is represented by the struct and union, but if the most significant bit of the pointer is not used by the platform, `mrb_method_t` should be packed in `uintptr_t` to reduce memory usage. `MRB_METHOD_TABLE_INLINE` is turned on by default for linux. --- mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mrbgems/mruby-bin-debugger/tools') diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c index dead4b2a8..43e538ab4 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c @@ -117,7 +117,7 @@ compare_break_method(mrb_state *mrb, mrb_debug_breakpoint *bp, struct RClass *cl { const char* class_name; const char* method_name; - struct RProc* m; + mrb_method_t m; struct RClass* sc; const char* sn; mrb_sym ssym; @@ -136,10 +136,10 @@ compare_break_method(mrb_state *mrb, mrb_debug_breakpoint *bp, struct RClass *cl } else if (method_p->class_name != NULL) { m = mrb_method_search_vm(mrb, &class_obj, method_sym); - if (m == NULL) { + if (MRB_METHOD_UNDEF_P(m)) { return MRB_DEBUG_OK; } - if (MRB_PROC_CFUNC_P(m)) { + if (MRB_METHOD_CFUNC_P(m)) { *isCfunc = TRUE; } @@ -151,7 +151,7 @@ compare_break_method(mrb_state *mrb, mrb_debug_breakpoint *bp, struct RClass *cl sc = mrb_class_get(mrb, method_p->class_name); ssym = mrb_symbol(mrb_check_intern_cstr(mrb, method_p->method_name)); m = mrb_method_search_vm(mrb, &sc, ssym); - if (m == NULL) { + if (MRB_METHOD_UNDEF_P(m)) { return MRB_DEBUG_OK; } -- cgit v1.2.3