summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-09-02 08:41:55 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 18:20:14 +0900
commit7f66e50ba2f71514da711a7927554956faea2f29 (patch)
tree035a3b9773a18132cee31d4e33bea8fc0dcab5fe
parent5592c7413a22c605ae3acaa71c36947b43f78ac6 (diff)
downloadmruby-7f66e50ba2f71514da711a7927554956faea2f29.tar.gz
mruby-7f66e50ba2f71514da711a7927554956faea2f29.zip
Explain `MRB_USE_MALLOC_TRIM`; ref #5069
-rw-r--r--doc/mruby3.md5
-rw-r--r--include/mrbconf.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/mruby3.md b/doc/mruby3.md
index c8ec76937..ae6e674e5 100644
--- a/doc/mruby3.md
+++ b/doc/mruby3.md
@@ -96,6 +96,11 @@ does not fit in `Fixnum` integers.
Pack `mrb_value` in a floating pointer number. Nothing
changed from previous versions.
+== `MRB_USE_MALLOC_TRIM`
+
+Call `malloc_trim(0)` from mrb_full_gc() if this macro is defined.
+If you are using glibc malloc, this macro could reduce memory consumption.
+
= Internal Changes
== `Random` now use `xoshiro128++`.
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 249bb72e4..89b3e9022 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -101,6 +101,9 @@
# endif
#endif
+/* call malloc_trim(0) from mrb_full_gc() */
+//#define MRB_USE_MALLOC_TRIM
+
/* string class to handle UTF-8 encoding */
//#define MRB_UTF8_STRING