diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guides/compile.md | 4 | ||||
| -rw-r--r-- | doc/guides/debugger.md | 4 | ||||
| -rw-r--r-- | doc/guides/gc-arena-howto.md | 6 | ||||
| -rw-r--r-- | doc/guides/link.md | 2 | ||||
| -rw-r--r-- | doc/guides/mrbconf.md | 40 | ||||
| -rw-r--r-- | doc/guides/mrbgems.md | 76 | ||||
| -rw-r--r-- | doc/mruby3.md | 8 | ||||
| -rw-r--r-- | doc/opcode.md | 6 |
8 files changed, 75 insertions, 71 deletions
diff --git a/doc/guides/compile.md b/doc/guides/compile.md index 740663ff8..7156b2b68 100644 --- a/doc/guides/compile.md +++ b/doc/guides/compile.md @@ -271,7 +271,7 @@ See doc/mrbgems/README.md for more option about mrbgems. Configuration Mrbtest build process. -If you want mrbtest.a only, You should set `conf.build_mrbtest_lib_only` +If you want `mrbtest.a` only, You should set `conf.build_mrbtest_lib_only` ```ruby conf.build_mrbtest_lib_only @@ -309,7 +309,7 @@ If you need to enable C++ exception explicitly add the following: conf.enable_cxx_exception ``` -#### C++ exception disabling. +#### C++ exception disabling If your compiler does not support C++, and you want to ensure you don't use mrbgem written in C++, you can explicitly disable diff --git a/doc/guides/debugger.md b/doc/guides/debugger.md index 2393c20b1..14c9bfebd 100644 --- a/doc/guides/debugger.md +++ b/doc/guides/debugger.md @@ -115,7 +115,7 @@ The breakpoint will be ordered in serial from 1. The number, which was given to the deleted breakpoint, will never be given to another breakpoint again. You can give multiple breakpoints to the specified the line number and method. -Be ware that breakpoint command will not check the validity of the class name and method name. +Be aware that the breakpoint command will not check the validity of the class name and method name. You can get the current breakpoint information by the following options. @@ -367,5 +367,5 @@ r #### Step Command This will run the program step by step. -When the method and the block are invoked, the program will be stop at the first row. +When the method and the block are invoked, the program will stop at the first row. The program, which is developed in C, will be ignored. diff --git a/doc/guides/gc-arena-howto.md b/doc/guides/gc-arena-howto.md index 192a10802..2c1cdc1fb 100644 --- a/doc/guides/gc-arena-howto.md +++ b/doc/guides/gc-arena-howto.md @@ -3,7 +3,7 @@ _This is an English translation of [Matz's blog post][matz blog post] written in Japanese._ _Some parts are updated to reflect recent changes._ -[matz blog post]: https://www.rubyist.net/~matz/20130731.html +[matz blog post]: <https://www.rubyist.net/~matz/20130731.html> When you are extending mruby using C language, you may encounter mysterious "arena overflow error" or memory leak or very slow @@ -46,7 +46,7 @@ no longer referenced in the Ruby world, and cannot be treated as garbage. In mruby, we recognize all objects created in C function are alive. Then we have no problem such as confusing a live object as dead. -This means that because we cannot collect truly dead object, we may +This means that because we cannot collect a truly dead object, we may lose efficiency, but as a trade-off the GC itself is highly portable. We can say goodbye to the problem that GC deletes live objects due to optimization which sometimes occurs in CRuby. @@ -140,7 +140,7 @@ inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list) } ``` -This is a real example, so a little bit complicated, but bear with me. +This is a real example, so slightly complicated, but bear with me. The essence of `Array#inspect` is that after stringifying each element of array using `inspect` method, we join them together so that we can get `inspect` representation of the entire array. diff --git a/doc/guides/link.md b/doc/guides/link.md index 4bef8414c..8d70330fc 100644 --- a/doc/guides/link.md +++ b/doc/guides/link.md @@ -7,7 +7,7 @@ You have two ways to link `libmruby` to your application. ## Executable Gems -If your application is relatively small, `mrbgem` is easier way to +If your application is relatively small, `mrbgem` is an easier way to create the executable. By tradition, the gem name start with `mruby-bin-`, e.g. `mruby-bin-debugger`. diff --git a/doc/guides/mrbconf.md b/doc/guides/mrbconf.md index 2e76464d2..b5bc8c85c 100644 --- a/doc/guides/mrbconf.md +++ b/doc/guides/mrbconf.md @@ -1,28 +1,28 @@ -# mruby configuration macros. +# mruby configuration macros -## How to use these macros. +## How to use these macros You can use mrbconfs with following ways: * Write them in `mrbconf.h`. - * Using compiler flags is preferred 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. + * Using compiler flags is preferred 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. + * 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. +## stdio setting `MRB_NO_STDIO` * When defined `<stdio.h>` functions won't be used. * Some features will be disabled when this is enabled: * `mrb_irep` load/dump from/to file. - * Compiling mruby script from file. + * Compiling mruby script from a file. * Printing features in **src/print.c**. -## Debug macros. +## Debug macros `MRB_USE_DEBUG_HOOK` @@ -54,16 +54,16 @@ You can use mrbconfs with following ways: * Default value is `0x40000 - MRB_STACK_GROWTH`. * Raises `RuntimeError` when stack size exceeds this value. -## Primitive type configuration. +## Primitive type configuration `MRB_USE_FLOAT32` -* When defined single precision floating point type(C type `float`) is used as `mrb_float`. -* Otherwise double precision floating point type(C type `double`) is used as `mrb_float`. +* When defined single precision floating-point type(C type `float`) is used as `mrb_float`. +* Otherwise, double precision floating-point type(C type `double`) is used as `mrb_float`. `MRB_NO_FLOAT` -* When defined removes floating point numbers from mruby. +* When defined removes floating-point numbers from mruby. * It makes mruby easier to handle in "Microcontroller without FPU" and "Kernel Space". `MRB_INT32` @@ -76,7 +76,7 @@ You can use mrbconfs with following ways: * When defined, or `MRB_INT32` are not defined on 64-bit CPU mode, `mrb_int` will be defined as `int64_t`. * Conflicts with `MRB_INT32`. -## Garbage collector configuration. +## Garbage collector configuration `MRB_GC_STRESS` @@ -104,7 +104,7 @@ You can use mrbconfs with following ways: * Defines value is `1024`. * Specifies number of `RBasic` per each heap page. -## Memory pool configuration. +## Memory pool configuration `POOL_ALIGNMENT` @@ -118,7 +118,7 @@ largest value of required alignment. * Specifies page size of pool page. * Smaller the value is increases memory overhead. -## State atexit configuration. +## State atexit configuration `MRB_FIXED_STATE_ATEXIT_STACK` @@ -131,7 +131,7 @@ largest value of required alignment. * Default value is `5`. * If `MRB_FIXED_STATE_ATEXIT_STACK` isn't defined this macro is ignored. -## `mrb_value` configuration. +## `mrb_value` configuration `MRB_ENDIAN_BIG` @@ -149,7 +149,7 @@ largest value of required alignment. * If defined represent `mrb_value` as a word. * If defined `Float` will be a mruby object with `RBasic`. -## Reduce heap memory configuration. +## Reduce heap memory configuration `MRB_USE_LINK_TIME_RO_DATA_P` @@ -167,7 +167,7 @@ largest value of required alignment. * The prototype declaration is `mrb_bool mrb_ro_data_p(const char *ptr)`. * Return `TRUE` if `ptr` is in the read-only section, otherwise return `FALSE`. -## Other configuration. +## Other configuration `MRB_UTF8_STRING` diff --git a/doc/guides/mrbgems.md b/doc/guides/mrbgems.md index 00e097f4c..d4160ebc8 100644 --- a/doc/guides/mrbgems.md +++ b/doc/guides/mrbgems.md @@ -33,7 +33,7 @@ conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master' conf.gem :bitbucket => 'mruby/mrbgems-example', :branch => 'master' ``` -You can specify the sub directory of the repository with `:path` option: +You can specify the subdirectory of the repository with `:path` option: ```ruby conf.gem github: 'mruby/mruby', path: 'mrbgems/mruby-socket' @@ -46,7 +46,7 @@ conf.gem :mgem => 'mruby-yaml' conf.gem :mgem => 'yaml' # 'mruby-' prefix could be omitted ``` -For specifying commit hash to checkout use `:checksum_hash` option: +For specifying the commit hash to checkout use `:checksum_hash` option: ```ruby conf.gem mgem: 'mruby-redis', checksum_hash: '3446d19fc4a3f9697b5ddbf2a904f301c42f2f4e' @@ -110,21 +110,23 @@ contains every gem found in the `mrbgems` directory. The maximal GEM structure looks like this: - +- GEM_NAME <- Name of GEM - | - +- README.md <- Readme for GEM - | - +- mrbgem.rake <- GEM Specification - | - +- include/ <- Header for Ruby extension (will exported) - | - +- mrblib/ <- Source for Ruby extension - | - +- src/ <- Source for C extension - | - +- tools/ <- Source for Executable (in C) - | - +- test/ <- Test code (Ruby) +``` ++- GEM_NAME <- Name of GEM + | + +- README.md <- Readme for GEM + | + +- mrbgem.rake <- GEM Specification + | + +- include/ <- Header for Ruby extension (will exported) + | + +- mrblib/ <- Source for Ruby extension + | + +- src/ <- Source for C extension + | + +- tools/ <- Source for Executable (in C) + | + +- test/ <- Test code (Ruby) +``` The folder `mrblib` contains pure Ruby files to extend mruby. The folder `src` contains C/C++ files to extend mruby. The folder `include` contains C/C++ header @@ -386,22 +388,24 @@ binary gems, to separate normal gems and binary gems. ### Example - +- mruby-bin-example/ - | - +- README.md (Optional) - | - +- bintest/ - | | - | +- example.rb <- Test code for binary gem - | - +- mrbgem.rake <- Gem specification - | - +- mrblib/ <- Source for Ruby extension (Optional) - | - +- src/ <- Source for C extension (Optional) - | - +- tools/ - | - +- example/ <- Executable name directory - | - +- example.c <- Source for Executable (includes main) +``` + +- mruby-bin-example/ + | + +- README.md (Optional) + | + +- bintest/ + | | + | +- example.rb <- Test code for binary gem + | + +- mrbgem.rake <- Gem specification + | + +- mrblib/ <- Source for Ruby extension (Optional) + | + +- src/ <- Source for C extension (Optional) + | + +- tools/ + | + +- example/ <- Executable name directory + | + +- example.c <- Source for Executable (includes main) +``` diff --git a/doc/mruby3.md b/doc/mruby3.md index aacbbb371..d5218428e 100644 --- a/doc/mruby3.md +++ b/doc/mruby3.md @@ -43,7 +43,7 @@ We have ported some new syntax from CRuby. ## Renamed for consistency Some configuration macro names are changed for consistency (use `MRB_USE_XXX` - or `MRB_NO_XXX`). +or `MRB_NO_XXX`). | mruby2 | mruby3 | |--------------------------------|---------------------------| @@ -61,7 +61,7 @@ Some configuration macro names are changed for consistency (use `MRB_USE_XXX` | `DISABLE_MIRB_UNDERSCORE` | `MRB_NO_MIRB_UNDERSCORE` | * `MRB_USE_FLOAT32` is changed from `MRB_USE_FLOAT` to make sure `float` here - means using single precision float, and not the opposite of `MRB_NO_FLOAT`. + means using single precision float, and not the opposite of `MRB_NO_FLOAT`. * `MRB_USE_METHOD_T_STRUCT` uses `struct` version of `mrb_method_t`. More portable but consumes more memory. Turned on by default on 32bit platforms. * `MRB_` prefix is added to those without. @@ -82,7 +82,7 @@ does not fit in `Fixnum` integers. ## `MRB_NAN_BOXING` -Pack `mrb_value` in a floating pointer number. Nothing +Pack `mrb_value` in a floating-point number. Nothing changed from previous versions. ## `MRB_USE_MALLOC_TRIM` @@ -152,7 +152,7 @@ No more operand extension Jump addresses used to be specified by absolute offset from the start of `iseq`. Now they are relative offset from the address of the next instruction. -## `Random` now use `xoshiro128++`. +## `Random` now use `xoshiro128++` For better and faster random number generation. diff --git a/doc/opcode.md b/doc/opcode.md index 3ad09919c..aca3a0827 100644 --- a/doc/opcode.md +++ b/doc/opcode.md @@ -101,9 +101,9 @@ sign) of operands. | OP_ARYCAT | B | ary_cat(R(a),R(a+1)) | | OP_ARYPUSH | B | ary_push(R(a),R(a+1)) | | OP_ARYDUP | B | R(a) = ary_dup(R(a)) | -| OP_AREF | BBB | R(a) = R(b)[c] | -| OP_ASET | BBB | R(a)[c] = R(b) | -| OP_APOST | BBB | *R(a),R(a+1)..R(a+c) = R(a)[b..] | +| OP_AREF | BBB | R(a) = R(b)[c] | <!-- markdownlint-disable --> +| OP_ASET | BBB | R(a)[c] = R(b) | <!-- markdownlint-disable --> +| OP_APOST | BBB | *R(a),R(a+1)..R(a+c) = R(a)[b..] | <!-- markdownlint-disable --> | OP_INTERN | B | R(a) = intern(R(a)) | | OP_STRING | BB | R(a) = str_dup(Lit(b)) | | OP_STRING16 | BS | R(a) = str_dup(Lit(b)) | |
