diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-11-30 23:46:04 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-01 12:27:19 +0900 |
| commit | b5842dea582bf94f868900e8e542fe4a1ecfdbd7 (patch) | |
| tree | 0ba47278ecda8279e072c8d9aaf3745fd1eddc71 /src/codedump.c | |
| parent | b137eb2678cfba8d6ffcddff5326ebe8eb7f6a24 (diff) | |
| download | mruby-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 'src/codedump.c')
0 files changed, 0 insertions, 0 deletions
