path: root/array.c
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 01:13:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-25 01:13:31 +0000
commit2bfd722d803ac26deabde267c3d84d1b1aa85f50 (patch)
treecb6d1f0b15b37e231800701b38f2f663e3b4e3c0 /array.c
parent84b7d6d533208bb9f73e3573ad2352dcf9e2e1b0 (diff)
* internal.h: do not use ruby_sized_xrealloc() and ruby_sized_xfree()
if HAVE_MALLOC_USABLE_SIZE (or _WIN32) is defined. We don't need these function if malloc_usable_size() is available. * gc.c: catch up this change. * gc.c: define HAVE_MALLOC_USABLE_SIZE on _WIN32. * array.c (ary_resize_capa): do not use ruby_sized_xfree() with local variable to avoid "unused local variable" warning. This change only has few impact. * string.c (rb_str_resize): ditto. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/array.c b/array.c
index 5d01fdb..baf6118 100644
--- a/array.c
+++ b/array.c
@@ -219,13 +219,12 @@ ary_resize_capa(VALUE ary, long capacity)
if (!ARY_EMBED_P(ary)) {
long len = RARRAY_LEN(ary);
const VALUE *ptr = RARRAY_CONST_PTR(ary);
- size_t size = ARY_HEAP_SIZE(ary);
if (len > capacity) len = capacity;
MEMCPY((VALUE *)RARRAY(ary)->as.ary, ptr, VALUE, len);
ARY_SET_LEN(ary, len);
- ruby_sized_xfree((VALUE *)ptr, size);
+ ruby_xfree((VALUE *)ptr);