* array.c: reduce use of RARRAY_LEN and ARY_CAPA when object is not
modified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_uniq): use rb_hash_values(), as well as the case no
block is given.
* internal.h: define rb_hash_values() as internal API.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_uniq): set class of the return value to the receiver
class. fix failure in TestArray#test_array_subclass.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_uniq): remove no longer used local variables since
r43194.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and
usecase of this macro is not acquire raw pointer, but acquire
read-only pointer. So we rename to better name.
RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR()
(I expect that nobody use it).
* array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c,
string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c:
catch up this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
there are not new relations.
* enum.c (enum_sort_by): ditto.
* struct.c (setup_struct): use RARRAY_RAWPTR().
* vm_eval.c (yield_under): ditto.
* ext/pathname/pathname.c (path_entries): use RARRAY_AREF().
* ext/pathname/pathname.c (path_s_glob): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
make it normal object.
* array.c (rb_ary_modify): use RARRAY_PTR_USE() without WB because
there are not new relations.
* array.c (ary_ensure_room_for_unshift): use RARRAY_RAWPTR() because
there are not new relations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
At least on my environments, I don't see any errors
with many trials. Please tell us if you find any GC bugs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_gc_unprotect_logging() which is general version
* include/ruby/ruby.h: add USE_RGENGC_LOGGING_WB_UNPROTECT
to enable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_initialize): use ary_memfill().
* array.c (rb_ary_fill): ditto.
* array.c (rb_ary_slice_bang): use RARRAY_RAWPTR() because
this code creates no new references.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Making non-shady shared array causes SEGV (see rubyci).
It seems a bug around shared array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_modify, ary_make_partial, rb_ary_splice,
rb_ary_replace, rb_ary_eql, rb_ary_compact_bang):
use RARRAY_RAWPTR() instead of RARRAY_PTR().
* array.c (rb_ary_shift): use RARRAY_PTR_USE() without WB because
there are not new relations.
* array.c (ary_ensure_room_for_unshift): ditto.
* array.c (rb_ary_sort_bang): ditto.
* array.c (rb_ary_delete_at): ditto.
* array.c (rb_ary_reverse_m): use RARRAY_RAWPTR() because
there are not new relations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because this operation creates a reference to Qnil.
* array.c (ary_make_shared, rb_ary_store, rb_ary_shift_m,
rb_ary_splice, rb_ary_resize, rb_ary_fill): use ary_mem_clear()
instead of rb_mem_clear().
* array.c (ary_make_shared): use RARRAY_RAWPTR() instead of RARRAY_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with write barrier. If ary is promoted, use write barrier correctly.
* array.c (rb_ary_cat, rb_ary_unshift_m, rb_ary_dup,
rb_ary_sort_bang, rb_ary_replace, rb_ary_plus): use ary_memcpy().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RARRAY_PTR. In this code, there are no "write" operation.
* array.c (rb_ary_equal): ditto.
* array.c (recursive_equal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because VALUE is not defined before including ruby/ruby.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
while iterating. Remove other pointer loop when arg is given.
* test/ruby/test_array.rb (test_count): add test for bug.
[ruby-core:56072] [Bug #8654]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_hash_to_a() to avoid array creation with rb_assoc_new().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e