From e5fbe350b306d9473db2a36780cfe2cac72e0c31 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 12 Jul 2017 14:52:03 +0900 Subject: Avoid float operation to shrink arena buffer size. --- src/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gc.c b/src/gc.c index 134b818ee..8199058f7 100644 --- a/src/gc.c +++ b/src/gc.c @@ -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; } -- cgit v1.2.3