From 1113d54edecb68eaa55aa07996dec3b6fd8422f6 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 26 Sep 2006 22:46:16 +0000 Subject: * array.c (rb_ary_shift): shift/unshift performance boost patch, based on the patch from Eric Mahurin . [ruby-core:05861] * array.c (rb_ary_unshift_m): ditto. * array.c (ary_make_shared): ditto. * array.c (RESIZE_CAPA): ditto. * array.c (rb_ary_free): new function to free memory. code moved from gc.c. * string.c (rb_str_free): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 6c83bd43b5..88de1d506a 100644 --- a/gc.c +++ b/gc.c @@ -1174,16 +1174,10 @@ obj_free(VALUE obj) } break; case T_STRING: - if (FL_TEST(obj, RSTRING_NOEMBED) && - RANY(obj)->as.string.as.heap.ptr && !FL_TEST(obj, ELTS_SHARED)) { - RUBY_CRITICAL(free(RANY(obj)->as.string.as.heap.ptr)); - } + rb_str_free(obj); break; case T_ARRAY: - if (FL_TEST(obj, RARRAY_NOEMBED) && - RANY(obj)->as.array.as.heap.ptr && !FL_TEST(obj, ELTS_SHARED)) { - RUBY_CRITICAL(free(RANY(obj)->as.array.as.heap.ptr)); - } + rb_ary_free(obj); break; case T_HASH: if (RANY(obj)->as.hash.tbl) { -- cgit v1.2.3