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
Showing
Please register or sign in to comment