From 94ae70e8eea0462c63e76e1e50147ec2db2aa7b5 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Thu, 19 Jun 2014 21:27:22 +0900 Subject: Add notes about how to use mrbconf. --- doc/mrbconf/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/mrbconf/README.md b/doc/mrbconf/README.md index 930e185da..bb30c0b12 100644 --- a/doc/mrbconf/README.md +++ b/doc/mrbconf/README.md @@ -1,5 +1,15 @@ # mruby configuration macros. +## How to use these macros. +You can use mrbconfs with following ways: +* Write them in `mrbconf.h`. + * Using compiler flags is prefered when building a cross binaries or multiple mruby binaries + since it's easier to use different mrbconf per each `MRuby::Build`. + * Most flags can be enabled by just commenting in. +* Pass them as compiler flags. + * Make sure you pass the same flags to all compilers since some mrbconf(e.g., `MRB_GC_FIXED_ARENA`) + changes `struct` layout and cause memory access error when C and other language(e.g., C++) is mixed. + ## stdio setting. `ENABLE_STDIO` * Will be defined automatically if `DISABLE_STDIO` isn't defined. -- cgit v1.2.3 From 412c86bb58c85057d85e4cbe780ca119051e2ae6 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Thu, 19 Jun 2014 21:39:01 +0900 Subject: Add primitive type configuration document. --- doc/mrbconf/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/mrbconf/README.md b/doc/mrbconf/README.md index bb30c0b12..1be60fc05 100644 --- a/doc/mrbconf/README.md +++ b/doc/mrbconf/README.md @@ -46,3 +46,19 @@ You can use mrbconfs with following ways: `MRB_STACK_MAX` * Default value is `0x40000 - MRB_STACK_GROWTH`. * Raises `RuntimeError` when stack size exceeds this value. + +## Primitive type configuration. + +`MRB_USE_FLOAT` +* When defined single precision floating point type(C type `float`) is used as `mrb_float`. +* Else double precision floating point type(C type `double`) is used as `mrb_float`. + +`MRB_INT16` +* When defined `int16_t` will be defined as `mrb_int`. +* Conflicts with `MRB_INT64`. + +`MRB_INT64` +* When defined `int64_t` will be defined as `mrb_int`. +* Conflicts with `MRB_INT16`. +* When `MRB_INT16` or `MRB_INT64` isn't defined `int`(most of the times 32-bit integer) +will be defined as `mrb_int`. -- cgit v1.2.3 From dd37c520683c6fe149cc8f976776ee94e1065cc2 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Thu, 19 Jun 2014 22:02:19 +0900 Subject: Document GC mrbconfs. --- doc/mrbconf/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/mrbconf/README.md b/doc/mrbconf/README.md index 1be60fc05..9532681eb 100644 --- a/doc/mrbconf/README.md +++ b/doc/mrbconf/README.md @@ -62,3 +62,22 @@ You can use mrbconfs with following ways: * Conflicts with `MRB_INT16`. * When `MRB_INT16` or `MRB_INT64` isn't defined `int`(most of the times 32-bit integer) will be defined as `mrb_int`. + +## Garbage collector configuration. + +`MRB_GC_STRESS` +* When defined full GC is emitted per each `RBasic` allocation. +* Mainly used in memory manager debugging. + +`MRB_GC_TURN_OFF_GENERATIONAL` +* When defined turns generational GC by default. + +`MRB_GC_FIXED_ARENA` +* When defined used fixed size GC arena. +* Raises `RuntimeError` when this is defined and GC arena size exceeds `MRB_GC_ARENA_SIZE`. +* Useful tracking unnecessary mruby object allocation. + +`MRB_GC_ARENA_SIZE` +* Default value 100. +* Ignored when `MRB_GC_FIXED_ARENA` isn't defined. +* Defines fixed GC arena size. -- cgit v1.2.3