avoid overflow in integer multiplication
This changeset basically replaces ruby_xmalloc(x * y) into ruby_xmalloc2(x, y). Some convenient functions are also provided for instance rb_xmalloc_mul_add(x, y, z) which allocates x * y + z byes.
ruby_xmalloc(x * y)
ruby_xmalloc2(x, y)
rb_xmalloc_mul_add(x, y, z)
avoid overflow in integer multiplication
This changeset basically replaces
ruby_xmalloc(x * y)intoruby_xmalloc2(x, y). Some convenient functions are alsoprovided for instance
rb_xmalloc_mul_add(x, y, z)which allocatesx * y + z byes.