diff options
-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 { |