summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/codegen.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-11-30 23:46:04 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-12-01 12:27:19 +0900
commitb5842dea582bf94f868900e8e542fe4a1ecfdbd7 (patch)
tree0ba47278ecda8279e072c8d9aaf3745fd1eddc71 /mrbgems/mruby-compiler/core/codegen.c
parentb137eb2678cfba8d6ffcddff5326ebe8eb7f6a24 (diff)
downloadmruby-b5842dea582bf94f868900e8e542fe4a1ecfdbd7.tar.gz
mruby-b5842dea582bf94f868900e8e542fe4a1ecfdbd7.zip
variable.c: reduce memory usage of instance variable table
This is a fundamentally simplified reimplementation of #5317 by @shuujii Instead of having array of `struct iv_elem`, we have sequences of keys and values packed in single chunk of malloc'ed memory. We don't have to worry about gaps from alignment, especially on 64 bit architecture, where `sizeof(struct iv_elem)` probably consumes 16 bytes, but `sizeof(mrb_sym)+sizeof(mrb_value)` is 12 bytes. In addition, this change could improve memory access locality. close #5317
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
0 files changed, 0 insertions, 0 deletions