summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-11 14:28:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-11 14:28:38 +0000
commit160d730ef446dc59726518499754ad877609a2f5 (patch)
tree77e16eb77d4aaa723b6e3ea221c627b2b5e4e768 /gc.c
parent8acaa122f5e5025ed45c8726c6a178201ae22496 (diff)
gc.c: skip unnecessary check
* gc.c (wmap_aset): skip unnecessary size check. `2*sizeof(VALUE)` is static and should never overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index ca66364889..16a6d41fbe 100644
--- a/gc.c
+++ b/gc.c
@@ -8464,7 +8464,7 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
else {
optr = 0;
size = 1;
- ptr = ruby_xmalloc2(2, sizeof(VALUE));
+ ptr = ruby_xmalloc0(2 * sizeof(VALUE));
}
ptr[0] = size;
ptr[size] = (VALUE)arg;