summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-11-20 06:34:27 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-11-20 18:33:41 +0900
commit8b7a8978e2da6c0a427e08af8593e82160033756 (patch)
treef4671ba0ebb094b614b28dedba854755dc5eecce
parent8f2c62407c0659d84126545e19505a851059e750 (diff)
downloadmruby-8b7a8978e2da6c0a427e08af8593e82160033756.tar.gz
mruby-8b7a8978e2da6c0a427e08af8593e82160033756.zip
Reduce the size of `struct RBreak` to reduce memory usage.
The old size of `struct RBreak` was 56 bytes (`MRB_NO_BOXING`) and it's bigger than other object structures. That increase the size of `RVALUE` thus increase the total amount of memory consumption.
-rw-r--r--include/mruby/error.h1
-rw-r--r--src/vm.c1
2 files changed, 0 insertions, 2 deletions
diff --git a/include/mruby/error.h b/include/mruby/error.h
index d7abbb14c..1587795fc 100644
--- a/include/mruby/error.h
+++ b/include/mruby/error.h
@@ -34,7 +34,6 @@ MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value);
struct RBreak {
MRB_OBJECT_HEADER;
- struct iv_tbl *iv;
struct RProc *proc;
mrb_value val;
};
diff --git a/src/vm.c b/src/vm.c
index 170cb832d..2c2d74db1 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -810,7 +810,6 @@ break_new(mrb_state *mrb, struct RProc *p, mrb_value val)
struct RBreak *brk;
brk = (struct RBreak*)mrb_obj_alloc(mrb, MRB_TT_BREAK, NULL);
- brk->iv = NULL;
brk->proc = p;
brk->val = val;