diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-12 14:52:03 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-12 14:52:03 +0900 |
| commit | e5fbe350b306d9473db2a36780cfe2cac72e0c31 (patch) | |
| tree | 23a11de2e898e8394b669b1d41edec80f1be4baf | |
| parent | 9501b183620a8b7ad9e98a0a2b9e205fefc3d9e7 (diff) | |
| download | mruby-e5fbe350b306d9473db2a36780cfe2cac72e0c31.tar.gz mruby-e5fbe350b306d9473db2a36780cfe2cac72e0c31.zip | |
Avoid float operation to shrink arena buffer size.
| -rw-r--r-- | src/gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1257,8 +1257,8 @@ mrb_gc_arena_restore(mrb_state *mrb, int idx) #ifndef MRB_GC_FIXED_ARENA int capa = gc->arena_capa; - if (idx < capa / 2) { - capa = (int)(capa * 0.66); + if (idx < capa / 4) { + capa >>= 2; if (capa < MRB_GC_ARENA_SIZE) { capa = MRB_GC_ARENA_SIZE; } |
