summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
2013-11-07* array.c: [DOC] Add note about negative indices in Array overviewzzak
By @ckaenzig [Fixes GH-427] https://github.com/ruby/ruby/pull/427 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07* array.c (rb_ary_shuffle_bang): use RARRAY_PTR_USE() without WBglass
because there are not new relations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07* array.c (rb_ary_sample): use rb_ary_dup().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06* array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB becauseglass
there are not new relations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06* array.c (rb_ary_reverse): use RARRAY_PTR_USE().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06* array.c (rb_ary_sample): use RARRAY_AREF() and RARRAY_PTR_USE()glass
instead of RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06* array.c (rb_ary_and): defer hash creation and some refactoring.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-30* array.c (rb_ary_uniq_bang): use rb_ary_modify_check() instead ofglass
rb_ary_modify() because the array will be unshared soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* array.c (rb_ary_zip): some refactoring.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* array.c (rb_ary_uniq_bang): use st_foreach() instead of for loop.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23* array.c: Add Array#to_h [Feature #7292]marcandre
* enum.c: Add Enumerable#to_h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17* gc.c, internal.h: rename ruby_xsizefree/realloc toko1
rb_sized_free/realloc. * array.c: catch up these changes. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17* array.c, string.c: use ruby_xsizedfree() and ruby_xsizedrealloc().ko1
* internal.h (SIZED_REALLOC_N): define a macro as REALLOC_N(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-15array.c: reduce RARRAY_LEN and ARY_CAPAnobu
* 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
2013-10-10* array.c (rb_ary_or): remove unused variables.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10* array.c (rb_ary_or): use rb_hash_keys().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10* array.c (rb_ary_compact_bang): use ary_resize_smaller().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08array.c: use rb_hash_valuesnobu
* 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
2013-10-08array.c: set classnobu
* 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
2013-10-08array.c: remove unused variablesnobu
* 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
2013-10-08* array.c (rb_ary_uniq): use rb_hash_keys().glass
* internal.h: define rb_hash_keys() as internal API. * hash.c (rb_hash_keys): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-29array.c: minor performance improvementnobu
* array.c (sort_2): minor performance improvement by replacing rb_funcall() with rb_funcallv. * array.c (rb_ary_bsearch, recursive_cmp, rb_ary_cycle_size): ditto. * array.c (descending_factorial, binomial_coefficient): ditto. * array.c (rb_ary_repeated_permutation_size): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-25* include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().ko1
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
2013-08-27array.c: optimized equalitynobu
* array.c (rb_ary_index, rb_ary_rindex): use optimized equality to improve performance. [Feature #8820] * vm_insnhelper.c (rb_equal_opt): optimized equality function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26* array.c (rb_ary_splice): use RARRAY_PTR_USE() without WB becauseko1
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
2013-08-26* array.c (ary_ensure_room_for_push): fix typo in r42658.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-23* array.c (ary_make_shared): shared ary as shady. Need more effort toko1
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
2013-08-23* array.c: introduce ARY_SHARED_OCCUPIED(shared).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-04* array.c (rb_ary_zip): performance implement by usingglass
ALLOCA_N() to allocate tmp buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* array.c (rb_ary_zip): use rb_ary_new2() to create bufferglass
if rb_block_arity() > 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02* array.c (rb_ary_zip): performance improvement by avoidingglass
array creation if rb_block_arity() > 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26* array.c (ary_memcpy): cast to int to suppress a warning.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26* array.c (ary_memcpy): try to enable optimization.ko1
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
2013-07-24* array.c, gc.c: move ary_unprotect_logging() intoko1
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
2013-07-22* array.c (ary_resize_capa): use RARRAY_RAWPTR() becauseko1
this code creates no new references. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-22* array.c (ary_memfill): added.ko1
* 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
2013-07-20* array.c (rb_ary_resize): use simple memcpy because there are no newko1
references. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-20* array.c (ary_make_shared): make shared array shady.ko1
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
2013-07-19* array.c: reduce shady operations.ko1
* 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
2013-07-19* array.c: reduce shade operations.ko1
* array.c (rb_ary_modify): use RARRAY_RAWPTR(). * array.c (ary_make_substitution, rb_ary_s_create, ary_make_partial, rb_ary_splice, rb_ary_resize, rb_ary_rotate_m, rb_ary_times): use ary_memcpy(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* array.c (ary_mem_clear): added. This operation doesn't need WBko1
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
2013-07-19* array.c: fix commit miss.ko1
RGENGC_UNPROTECT_LOGGING should be 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* array.c (rb_ary_resurrect): use RARRAY_RAWPTR() because there is noko1
writing. * array.c (rb_ary_new_from_values): use ary_memcpy(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* array.c (ary_memcpy): add a function to copy VALUEs into aryko1
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
2013-07-19* array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR().ko1
Clearing memory space doesn't need WBs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* array.c (ary_ensure_room_for_push): use RARRAY_RAWPTR() instead ofko1
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
2013-07-19* array.c (ary_unprotect_logging): use (void *) for first parameterko1
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
2013-07-18* array.c (rb_ary_eql): compare RARRAY_PTR() for performanceglass
improvement in case of that self and other are shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-18* array.c (rb_ary_equal): compare RARRAY_PTR() for performanceglass
improvement in case of that self and other are shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e