summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-06-27 17:38:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:22 +0900
commit639946a006c29f648551512af8aa0bb0cd969412 (patch)
tree772fd60110e0492a42df513106d9e150b932645c /include/mruby.h
parentfb5e8ab6d5fa9b7ca08c7b66ac8038940534db70 (diff)
downloadmruby-639946a006c29f648551512af8aa0bb0cd969412.tar.gz
mruby-639946a006c29f648551512af8aa0bb0cd969412.zip
Enable method cache by default.
Introduced `MRB_NO_METHOD_CACHE` which is inverse of `MRB_METHOD_CACHE` that should be enabled intestinally. In addition, the default cache is made bigger (128 -> 256).
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 27c428e85..c9425e8a7 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -188,11 +188,11 @@ struct mrb_context {
};
#ifdef MRB_METHOD_CACHE_SIZE
-# define MRB_METHOD_CACHE
+# undef MRB_NO_METHOD_CACHE
#else
-/* default method cache size: 128 */
+/* default method cache size: 256 */
/* cache size needs to be power of 2 */
-# define MRB_METHOD_CACHE_SIZE (1<<7)
+# define MRB_METHOD_CACHE_SIZE (1<<8)
#endif
/**
@@ -218,7 +218,7 @@ typedef struct {
} mrb_method_t;
#endif
-#ifdef MRB_METHOD_CACHE
+#ifndef MRB_NO_METHOD_CACHE
struct mrb_cache_entry {
struct RClass *c, *c0;
mrb_sym mid;
@@ -264,7 +264,7 @@ typedef struct mrb_state {
mrb_gc gc;
-#ifdef MRB_METHOD_CACHE
+#ifndef MRB_NO_METHOD_CACHE
struct mrb_cache_entry cache[MRB_METHOD_CACHE_SIZE];
#endif