summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
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
2013-07-18* array.c (rb_ary_fill): use memfill().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-18* array.c (rb_ary_count): check length to avoid SEGVeregon
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
2013-07-18* hash.c (rb_hash_flatten): performance improvement by not usingglass
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
2013-07-18* array.c: add logging feature for RGenGC's write barrier unprotectko1
event. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-18* array.c (ary_alloc): slim setup process.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-16array.c: fix typonobu
* array.c (rb_ary_count): [DOC] fix typo. Array#count uses ==, not ===. a question at asakusa.rb ML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-11* array.c: Replace confusing example for #reverse_each in overviewzzak
Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12] https://github.com/documenting-ruby/ruby/pull/12 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26intern.h: define rb_enumerator_size_funcnobu
* include/ruby/intern.h (rb_enumerator_size_func): define strict function declaration for rb_enumeratorize_with_size(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-23* array.c: Return value in Array overview example found by @PragTobzzak
[Fix GH-336] https://github.com/ruby/ruby/pull/336 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-23* array.c (rb_ary_zip): typo by @PragTob [Fix GH-337]zzak
https://github.com/ruby/ruby/pull/337 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21* include/ruby/ruby.h: constify RArray::as::ary and RArray::heap::ptr.ko1
Use RARRAY_ASET() or RARRAY_PTR_USE() to modify Array objects. * array.c, gc.c: catch up above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12array.c: fix false assertionsnobu
* array.c (rb_ary_sort_bang): remove duplicated assertions. ARY_HEAP_PTR() implies ary not to be embedded. [ruby-dev:47419] [Bug #8518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12array.c: freeze in callbacknobu
* array.c (rb_ary_uniq_bang): must not be modified once frozen even in a callback method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12array.c: freeze in callbacknobu
* array.c (rb_ary_sort_bang): must not be modified once frozen even in a callback method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12array.c: fix false assertionnobu
* array.c (FL_SET_EMBED): shared object is frozen even when get unshared. * array.c (rb_ary_modify): ARY_SET_CAPA needs unshared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12array.c: assertionnobu
* array.c (ary_shrink_capa): additional assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11array.c: fix false assertion in ary_make_sharednobu
* array.c (ary_shrink_capa): shrink the capacity so it fits just with the length. * array.c (ary_make_shared): release never used elements from frozen array to be shared. [ruby-dev:47416] [Bug #8510] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10fix a typokazu
* array.c (rb_ary_new_from_values): fix a typo. pointed out by nagachika. http://d.hatena.ne.jp/nagachika/20130610/ruby_trunk_changes_41199_41220 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10* array.c (rb_ary_new_from_values): add assertionko1
(ary should be young object). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 * array.c (ary_new): change order of allocation in order tarui
to remove FL_OLDGEN operation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* array.c (Array#+): fix documentation example.eregon
Patch by Logan Serman. [Fixes GH-324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31array.c: new names of rb_ary_new familynobu
* array.c (rb_ary_new_capa): add better names of rb_ary_new2. * array.c (rb_ary_new_from_args): ditto for rb_ary_new3. * array.c (rb_ary_new_from_values): ditto for rb_ary_new4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* hash.c (rb_hash_tbl_raw), internal.h: added.ko1
Returns st_table without shading hash. * array.c: use rb_hash_tbl_raw() for read-only purpose. * compile.c (iseq_compile_each): ditto. * gc.c (count_objects): ditto. * insns.def: ditto. * process.c: ditto. * thread.c (clear_coverage): ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* gc.c: support RGENGC. [ruby-trunk - Feature #8339]ko1
See this ticet about RGENGC. * gc.c: Add several flags: * RGENGC_DEBUG: if >0, then prints debug information. * RGENGC_CHECK_MODE: if >0, add assertions. * RGENGC_PROFILE: if >0, add profiling features. check GC.stat and GC::Profiler. * include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0). * array.c: add write barriers for T_ARRAY and generate sunny objects. * include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if you want to access raw pointers. If you modify the contents which pointer pointed, then you need to care write barrier. * bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects. * complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX and generate sunny objects. * rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write barriers for T_RATIONAL and generate sunny objects. * internal.h: add write barriers for RBasic::klass. * numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects. * object.c (rb_class_allocate_instance), range.c: generate sunny T_OBJECT objects. * string.c: add write barriers for T_STRING and generate sunny objects. * variable.c: add write barriers for ivars. * vm_insnhelper.c (vm_setivar): ditto. * include/ruby/ruby.h, debug.c: use two flags FL_WB_PROTECTED and FL_OLDGEN. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED): move flag bits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* include/ruby/ruby.h: constify RBasic::klass and addko1
RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-24* array.c: Improve rdoc for eql?marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-24* array.c: Fix documentation for Array#index and #replace aliaseszzak
Based on a patch by @phiggins [Fixes GH-282] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-22enhanced Array#delete_if docs by johnnymugshsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e