| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Please refer this ticket for details.
This change also introduces the following changes.
* Remove RGENGC_AGE2_PROMOTION and introduce object age (0 to 3).
Age can be count with FL_PROMOTE0 and FL_PROMOTE1 flags in
RBasic::flags (2 bit). Age == 3 objects become old objects.
* WB_PROTECTED flag in RBasic to WB_UNPROTECTED bitmap.
* LONG_LIVED bitmap to represent living objects while minor GCs
It specifies (1) Old objects and (2) remembered shady objects.
* Introduce rb_objspace_t::marked_objects which counts marked
objects in current marking phase. marking count is needed to
introduce incremental marking.
* rename mark related function and sweep related function to
gc_(marks|sweep)_(start|finish|step|rest|continue).
* rename rgengc_report() to gc_report().
* Add obj_info() function to get cstr of object details.
* Add MEASURE_LINE() macro to measure execution time of specific line.
* and many small fixes.
* include/ruby/ruby.h: add flag USE_RINCGC.
Now USE_RINCGC can be set only with USE_RGENGC.
* include/ruby/ruby.h: introduce FL_PROMOTED0 and add FL_PROMOTED1
to count object age.
* include/ruby/ruby.h: rewrite write barriers for incremental marking.
* debug.c: catch up flag name changes.
* internal.h: add rb_gc_writebarrier_remember() instead of
rb_gc_writebarrier_remember_promoted().
* array.c (ary_memcpy0): use rb_gc_writebarrier_remember().
* array.c (rb_ary_modify): ditto.
* hash.c (rb_hash_keys): ditto.
* hash.c (rb_hash_values): ditto.
* object.c (init_copy): use rb_copy_wb_protected_attribute() because
FL_WB_PROTECTED is moved from RBasic::flags.
* test/objspace/test_objspace.rb: catch up ObjectSpace.dump() changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* array.c (rb_ary_any_p), hash.c (rb_hash_any_p): optimized
versions. these are bit faster than optimization in
Enumerable#any?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
When name contains '=', ruby_setenv raises Errno::EINVAL.
That is the same behavior as Solaris 10.
NULL check for malloc return value is also added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_initialize, rb_hash_fetch_m, rb_hash_default):
use rb_check_arity over rb_scan_args.
(env_fetch): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (env_shift): fix memory leak on Windows, free environment
strings block always. [ruby-dev:48332] [Bug #9983]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (env_select): fix memory leak and crash on Windows, make
keys array first instead of iterating on envrion directly.
[ruby-dev:48325] [Bug #9978]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (env_name): also store a coerced string to get rid of a
dangling pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (ruby_setenv): fix memory leak on Windows, free
environment strings block after check for the size.
[ruby-dev:48323] [Bug #9977]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (get_env_ptr, env_name): extract check for bad
environment variable name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (env_aset, env_has_key, env_assoc, env_has_value),
(env_rassoc, env_key): prohibit tainted strings if $SAFE is
non-zero. [Bug #9976]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (invalid_envname, check_envname): not used on platforms
other than Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (env_str_transcode): convert with replacing invalid/undef
characters, on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (env_str_new, env_path_str_new): replace invalid or
undefined conversions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (env_path_str_new): make PATH environment variable
string, to be frozen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/ruby/ruby.h (RHASH): ditto.
* include/ruby/ruby.h (RHASH_ITER_LEV): deprecated. Will be deleted later.
* include/ruby/ruby.h (RHASH_IFNONE): ditto.
* internal.h (struct RHash): moved here.
* internal.h (RHASH): ditto.
* hash.c (rb_hash_iter_lev): do not use this.
* hash.c (rb_hash_ifnone): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* array.c (rb_ary_equal), hash.c (hash_equal): use predefined IDs,
`to_ary` and `to_hash` respectively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* hash.c (rb_hash_keys): make an internal public function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_any_hash): use ID_SCOPE_SHIFT instead of magic number.
[Feature #9425]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* st.c (hash_pos): use bitwise AND to avoid slow modulo op
(new_size): power-of-two sizes for hash_pos change
(st_numhash): adjust for common keys due to lack of prime modulo
[Feature #9425]
* hash.c (rb_any_hash): right shift for symbols
* benchmark/bm_hash_aref_miss.rb: added to show improvement
* benchmark/bm_hash_aref_sym_long.rb: ditto
* benchmark/bm_hash_aref_str.rb: ditto
* benchmark/bm_hash_aref_sym.rb: ditto
* benchmark/bm_hash_ident_num.rb: added to prevent regression
* benchmark/bm_hash_ident_obj.rb: ditto
* benchmark/bm_hash_ident_str.rb: ditto
* benchmark/bm_hash_ident_sym.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
add links to `Object#hash` to each #`hash` methods rdocs.
[Fixes GH-567]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* class.c (rb_mod_init_copy): do nothing if copying self.
[ruby-dev:47989] [Bug #9535]
* hash.c (rb_hash_initialize_copy): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
[ruby-dev:47988] [Bug #9533]
* test/ruby/test_array.rb: test for above. patch is from
Takeshi Sasaki.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
[ruby-dev:47988] [Bug #9533]
* test/ruby/test_array.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* insns.def (opt_aref_with): new instruction to optimize Hash#[],
removing any allocation overhead when used with a string literal
key. Patch by normalperson (Eric Wong). [ruby-core:59640] [Bug #9382]
* insns.def (opt_aset_with): new instruction to optimize Hash#[]=
* compile.c (iseq_compile_each): compiler shortcuts for new
instructions
* hash.c (static VALUE rb_hash_compare_by_id_p): fix documentation for
Hash#compare_by_identity to reflect frozen string sharing
* test/ruby/test_hash.rb (class TestHash): test for new behavior
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* object.c (rb_obj_hash): follow above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
as `long', because ruby assumes the object id of an object is `long'.
this fixes test failures on mswin64 introduced at r44525.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* hash.c (rb_objid_hash): return hash value from object ID with a
salt, extract from rb_any_hash().
* object.c (rb_obj_hash): return same value as rb_any_hash().
fix r44125. [ruby-core:59638] [Bug #9381]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
it is no longer used from array.c since r43969.
the patch is from normalperson (Eric Wong).
[ruby-core:59449] [Feature #9336]
* internal.h: remove definition of rb_hash_keys().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): remove dead code for the deprecated
behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (HASH_REJECT_COPY_EXTRA_STATES): turn off the old
behavior, copying extra states by accident.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): use words "extra states".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (has_extra_methods): traverse ancestors, and fix infinite
loop. [Bug #9275]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (HAS_EXTRA_STATES): remove extra parenthesis.
[Bug #9275]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (HAS_EXTRA_STATES): warn extra states only when something
differ. [ruby-core:59254] [Bug #9275]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (HAS_EXTRA_STATES, rb_hash_reject): use words
"extra states".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
RB_OBJ_WRITE and RB_OBJ_WRITTEN.
* array.c, class.c, compile.c, hash.c, internal.h, iseq.c,
proc.c, process.c, re.c, string.c, variable.c, vm.c,
vm_eval.c, vm_insnhelper.c, vm_insnhelper.h,
vm_method.c: catch up this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): revert to deprecated behavior, with
warnings, due to compatibility for HashWithDifferentAccess.
[ruby-core:59154] [Bug #9223]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): warn attributes in detail more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): fix typo in macro name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_dup_empty): split from rb_hash_dup.
* hash.c (rb_hash_reject): add warnings (currently suppressed).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* hash.c (rb_hash): rewrite with while instead of goto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): return a plain hash, without copying
the class, default value, instance variables, and taintedness.
they had been copied just by accident.
[ruby-core:59045] [Bug #9223]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* array.c (rb_ary_hash): add salt to differentiate false and empty
array. [ruby-core:58993] [Bug #9231]
* hash.c (rb_any_hash, rb_hash_hash): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_replace): fix segv on `{}.replace({})` introduced
in r44060 [Bug #9230] [ruby-core:58991]
* test/ruby/test_hash.rb: regression test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): result should be infected by the
receiver.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_replace): add a write barrier to fix GC mark miss on
hashes using Hash#replace [Bug #9226] [ruby-core:58948]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_aset_str): revert r43870 due to performance issue
[Bug #9188] [ruby-core:58730]
* parse.y (assoc): convert literal string hash keys to fstrings
* test/ruby/test_hash.rb (class TestHash): expand test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_reject): copy unrejected elements only to new hash,
so that the change on the original receiver can affect.
[ruby-core:58914] [Bug #9223]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* hash.c (rb_hash): revert r43981 and bail out to the outermost frame
when recursion is detected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* hash.c (rb_hash_recursive): make similar (recursive) constructs
return same hash value. execute recursively, and rewind to the
topmost frame with an object which .eql? to the recursive
object, if recursion is detected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|