summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h3
-rw-r--r--include/mruby/value.h13
2 files changed, 16 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 3564f6ec5..0195ae96f 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -38,6 +38,9 @@
/* initial size for IV khash; ignored when MRB_USE_IV_SEGLIST is set */
//#define MRB_IVHASH_INIT_SIZE 8
+/* if _etext and _edata available, mruby can reduce memory used by symbols */
+//#define MRB_USE_ETEXT_EDATA
+
/* turn off generational GC by default */
//#define MRB_GC_TURN_OFF_GENERATIONAL
diff --git a/include/mruby/value.h b/include/mruby/value.h
index f85cdd644..09d00302e 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -211,4 +211,17 @@ mrb_undef_value(void)
return v;
}
+#ifdef MRB_USE_ETEXT_EDATA
+extern char _etext[];
+extern char _edata[];
+
+static inline mrb_bool
+mrb_ro_data_p(const char *p)
+{
+ return _etext < p && p < _edata;
+}
+#else
+# define mrb_ro_data_p(p) FALSE
+#endif
+
#endif /* MRUBY_VALUE_H */