diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-16 02:24:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-16 02:24:58 +0000 |
commit | efc605aeadf6f428b3ceecb749ed325290f79d66 (patch) | |
tree | 077d3c6124832c82d2a30c9f81bcb4596bedb9a5 | |
parent | 23c5ee8a9db3539549f40a177913072a85948901 (diff) |
* array.c (ary_shared_first): should create embedded copies
instead of sharing memory region for smaller arrays.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | .cvsignore | 1 | ||||
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | array.c | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/.cvsignore b/.cvsignore index 5004a53b70..9709c87cbc 100644 --- a/.cvsignore +++ b/.cvsignore @@ -34,6 +34,7 @@ newdate.rb newver.rb parse.c patches +patches-master pitest.rb ppack preview @@ -1,3 +1,8 @@ +Sat Sep 16 11:03:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * array.c (ary_shared_first): should create embedded copies + instead of sharing memory region for smaller arrays. + Sat Sep 16 09:37:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * struct.c (inspect_struct): do not display a class name for @@ -474,7 +474,7 @@ ary_shared_first(int argc, VALUE *argv, VALUE ary, int last) if (last) { offset = RARRAY_LEN(ary) - n; } - if (ARY_EMBED_P(ary)) { + if (ARY_EMBED_P(ary) || n <= RARRAY_EMBED_LEN_MAX) { return rb_ary_new4(n, RARRAY_PTR(ary)+offset); } else { |