summaryrefslogtreecommitdiff
path: root/hash.c
AgeCommit message (Collapse)Author
2013-12-05hash.c: bail out to the outermost framenobu
* 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
2013-12-03hash.c: same hash value for similar constructsnobu
* 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
2013-12-03hash.c: detect recursion for allnobu
* hash.c (rb_hash): detect recursion for all `hash' methods. each `hash' methods no longer need to use rb_exec_recursive(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03* array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new().glass
[Bug #9187] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03* hash.c (w32_getenv): should be static.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02* hash.c (getenv): fixed test failures introduced by r43950.usa
[ruby-core:58774] [Bug #9195] reported by phasis68 (Heesob Park). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02* hash.c (rb_hash_rehash): make temporary st_table under the controlglass
of GC. [Bug #9187] * test/ruby/test_hash.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01* hash.c (getenv): use ANSI codepage version of getenv() for minirubyusa
on Windows. [ruby-core:58732] [Bug #9189] reported by phasis68 (Heesob Park). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01* hash.c (rb_hash_to_a): specify array capa.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01* hash.c (rb_hash_rehash): fix to free new st_table when exceptionglass
is raised in do_hash(). [Bug #9187] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28* st.c: add st_values() and st_values_check().glass
* include/ruby/st.h: add prototypes for above. * hash.c (rb_hash_values): use st_values_check() for performance improvement if VALUE and st_data_t are compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28* st.c (st_keys): fix not to use Qundef in st.c.glass
* include/ruby/st.h: define modified prototype. * hash.c (rb_hash_keys): use modified st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* st.c (st_keys): fix to use st_index_t for size of hash.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* st.c (st_keys): define st_keys(). it writes each key to buffer.glass
* hash.c (rb_hash_keys): use st_keys() for performance improvement if st_data_t and VALUE are compatible. * st.h: define macro ST_DATA_COMPATIBLE_P() to predicate whether st_data_t and passed type are compatible. * configure.in: check existence of builtin function to use in ST_DATA_COMPATIBLE_P(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* gc.c (gc_page_sweep): Fix compile warning from last commit.tmm1
* hash.c (hash_aset_str): Re-use existing variable to avoid unnecessary pointer dereferencing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* hash.c (hash_aset_str): Use rb_fstring() to de-duplicate hash stringtmm1
keys. Patch by Eric Wong. [Bug #8998] [ruby-core:57727] * test/ruby/test_hash.rb (class TestHash): test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26should not ignore the rest of recursive constructsnobu
* array.c (rb_ary_hash): should not ignore the rest of recursive constructs. * hash.c (rb_hash_hash): ditto. * range.c (range_hash): ditto. * struct.c (rb_struct_hash): ditto. * test/-ext-/test_recursion.rb (TestRecursion): separate from test/ruby/test_thread.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26hash.c: cut off if recursionnobu
* hash.c (rb_hash): cut off if recursion detected to get rid of stack overflow. [ruby-core:58567] [Bug #9151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-17hash.c: static internal functionsnobu
* hash.c (NOINSERT_UPDATE_CALLBACK): make both of noinsert and insert internal functions static. and put semicolons for etags to find the following functions properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-15 * cont.c : Introdule ensure rollback mechanism. Please see below.tarui
* internal.h (ruby_register_rollback_func_for_ensure): catch up above change. Add rollback mechanism API. * vm_core.h (typedef struct rb_vm_struct): catch up above change. Introdule ensure-rollback relation table. * vm_core.h (typedef struct rb_thread_struct): catch up above change. Introdule ensure stack. * eval.c (rb_ensure): catch up above change. Introdule ensure stack. * hash.c : New function for rollback ensure, and register it to ensure-rollback relation table. [ruby-dev:47803] [Bug #9105] Ensure Rollback Mechanism: A rollback's function is a function to rollback a state before ensure's function execution. When the jump of callcc is across the scope of rb_ensure, ensure's functions and rollback's functions are executed appropriately for keeping consistency. Current API is unstable, and only internal use. ruby_register_rollback_func_for_ensure(ensure_func,rollback_func) This API create relation ensure's function to rollback's function. By registered rollback's function, it is executed When jumpping into corresponding rb_ensure scope. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-15revert r43675 and r43683 without tests for applying rollback patch.tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-15hash.c: iteration level with reenteringnobu
* hash.c (hash_foreach_iter, hash_foreach_ensure, rb_hash_foreach): deal with iteration level when reentering by callcc. temporary measure until rollback of ensure is introduced. [ruby-dev:47807] [Bug #9105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14hash.c: restore iter_levnobu
* hash.c (hash_foreach_ensure): restore iter_lev to the previous value, not just decrement. [ruby-dev:47803] [Bug #9105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14hash.c, st.c: fix for ST_CHECKnobu
* hash.c (foreach_safe_i, hash_foreach_iter): deal with error detected by ST_CHECK. * st.c (st_foreach_check): call with non-error argument in normal case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13* hash.c: [DOC] Adds an example for Hash#storezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-11* internal.h: move common string/hash flags to include file.tmm1
* ext/objspace/objspace_dump.c: remove flags shared above. * hash.c: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10st.c: revert st_keysnobu
* st.c: revert st_keys() at r43238. VALUE cannot be in st.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10* st.c (st_keys): define st_keys() for performance improvement ofglass
Hash#keys and Array#uniq. * st.h: ditto. * hash.c (rb_hash_keys): use st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43238 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-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-10-03* hash.c (env_update): [DOC] fix expected output, should be 0 insteadcharliesome
of 10. Patch by @yakko. [GH-411] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-23* hash.c (env_each_pair): do not call rb_assoc_new() ifglass
it isn't needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-13hash.c: utility functions from ruby_setenvnobu
* hash.c (invalid_envname, check_envname): extract utility functions from ruby_setenv(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb:ktsj
$SAFE=4 is obsolete. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-14* hash.c (rb_hash_aset): [DOC] Document key dup patch by @kachickzzak
[Fixes GH-382] https://github.com/ruby/ruby/pull/382 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29* hash.c (rb_hash_compare_by_id): add function prototype.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29* hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()glass
if self.compare_by_identity? == true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29* hash.c (rb_hash_assoc): performance improvement by replacingglass
compare function in RHASH(hash)->ntbl->type temporarily like r42224. it falls back to rb_hash_foreach() if st_lookup() doesn't find the key. * test/ruby/test_hash.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29* hash.c (rb_hash_assoc): revert r42224. table->type->compare isglass
called only if hashes are matched. * test/ruby/test_hash.rb: add a test to check using #== to compare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29ChangeLog: commit missnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29* hash.c (rb_hash_assoc): performance improvement by replacingglass
compare function in RHASH(hash)->ntbl->type temporarily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-20* hash.c (rb_hash_flatten): use NUM2INT to raise TypeError on 32bitnaruse
platform. it's introduced by r42039 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42093 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@42039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-17* hash.c (delete_if_i): use ST_DELETE.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-17* hash.c (rb_hash_replace): performance improvement by usingglass
st_copy(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-17hash.c: key name in error messagenobu
* hash.c (env_fetch): Add key name to message on ENV.fetch KeyError, as well as Hash#fetch. [ruby-core:56062] [Feature #8649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-15* hash.c (rb_hash_each_pair): performance improvement by usingglass
rb_block_arity(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-12* hash.c (rb_hash_reject_bang): do not call rb_hash_foreach() if RHashglass
has ntbl and it is empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-12* hash.c (recursive_hash): use RHASH_SIZE() to check hash size.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-11* hash.c (rb_hash_size): use RHASH_SIZE().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e