summaryrefslogtreecommitdiffhomepage
path: root/src/load.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-08-20 16:57:33 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-08-21 15:25:58 +0900
commit36632f55f418bd711112b72d7fe1b6b1745058e5 (patch)
tree30a9a0e83fced5759b5da8f2354b7ba02280e2b8 /src/load.c
parent4ea80913c27264df0c7088367109c5a0678879f1 (diff)
downloadmruby-36632f55f418bd711112b72d7fe1b6b1745058e5.tar.gz
mruby-36632f55f418bd711112b72d7fe1b6b1745058e5.zip
boxing_word.h: embed `mrb_float` in `mrb_value` if possible.
Embedding reduce memory consumption, sacrificing precision. It clips least significant 2 bits from `mrb_float`, so if you need to keep float precision, define `MRB_USE_FLOAT_FULL_PRECISION`. `MRB_WORD_BOXING` and `MRB_INT64`: `mrb_float` (`double`) is embedded in `mrb_value` clipped last 2 bits. `MRB_WORD_BOXING` and `MRB_INT64` and `MRB_USE_FLOAT_FULL_PRECISION`: `mrb_float` is allocated in the heaps wrapped by `struct RFloat`. `MRB_WORD_BOXING` and `MRB_INT32` and `MRB_USE_FLOAT32`: `mrb_float` (`float`) is embedded in `mrb_value` clipped last 2 bits. In addition, to reserve bit space in the `mrb_value`, maximum inline symbol length become 4 (instead of 5) in the configuration. `MRB_WORD_BOXING` and `MRB_INT32`: Assume `MRB_USE_FLOAT_FULL_PRECISION` and allocate Float values in heap.
Diffstat (limited to 'src/load.c')
0 files changed, 0 insertions, 0 deletions