aboutsummaryrefslogtreecommitdiffstats
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
commit4fe9df3d6591e0179dce7873eadbcc446005f72a (patch)
tree77e16eb77d4aaa723b6e3ea221c627b2b5e4e768 /gc.c
parent3f7284fe95217ef5da0b58ed0dd86691082424ad (diff)
downloadruby-4fe9df3d6591e0179dce7873eadbcc446005f72a.tar.gz
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;