mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Use free with ruby_dtoa
In ae0ceafb0c
ruby_dtoa was switched to
use malloc instead of xmalloc, which means that consumers should be
using free instead of xfree. Otherwise we will artificially shrink
oldmalloc_increase_bytes.
This commit is contained in:
parent
5f81f58b26
commit
0c3593b657
3 changed files with 3 additions and 3 deletions
|
@ -1078,7 +1078,7 @@ flo_to_s(VALUE flt)
|
|||
s = sign ? rb_usascii_str_new_cstr("-") : rb_usascii_str_new(0, 0);
|
||||
if ((digs = (int)(e - p)) >= (int)sizeof(buf)) digs = (int)sizeof(buf) - 1;
|
||||
memcpy(buf, p, digs);
|
||||
xfree(p);
|
||||
free(p);
|
||||
if (decpt > 0) {
|
||||
if (decpt < digs) {
|
||||
memmove(buf + decpt + 1, buf + decpt, digs - decpt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue