aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
Commit message (Collapse)AuthorAgeFilesLines
* * hash.c (ruby_setenv): MSDN says that Windows XP or earlier limitsusa2011-03-081-0/+1
| | | | | | | | | the total size of environment block to 5,120 chars. and on such OS, putenv() causes SEGV. So, ruby should limit the size of an environment variable to 5,120 bytes for workaround. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (inspect_i): copy the encoding of the first key asnaruse2011-02-151-1/+5
| | | | | | an initial encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_fetch_m): use useful message for longer key, not anobu2011-01-301-1/+2
| | | | | | nonsense id value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediatekosaki2011-01-271-1/+1
| | | | | | | | variable from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (hash_i): return different values for inverse hash.nobu2011-01-111-2/+6
| | | | | | [ruby-core:34334] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: parenthesize macro arguments.akr2010-12-141-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_update_by): new API for Hash#update.nobu2010-12-041-0/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-1/+1
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_aref): skip calling "default" methodko12010-10-151-1/+8
| | | | | | | | if it is not neede for speed-up. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu2010-10-121-9/+15
| | | | | | | | | | | | | | (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): workaround for old Windows. a patch fromusa2010-09-301-1/+2
| | | | | | | Heesob Park. [ruby-core:32353] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): raise if putenv and SetEnvironmentVariablenobu2010-09-111-15/+14
| | | | | | | | failed, because of the restriction of the size on Windows. based on a patch from Peter Weldon at [ruby-core:32304]. fix: Bug#3812, [ruby-core:32250] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_check_hash_type): added.nobu2010-08-031-1/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-43/+43
| | | | | | | | | | | | | | * enum.c: Documentation: whitespace fix for r27865 * error.c: ditto * file.c: ditto * io.c: ditto * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_fetch, rb_ary_splice, rb_ary_store): Improve IndexErrormarcandre2010-05-081-1/+5
| | | | | | | | messages [ruby-core:28394] * hash.c (rb_hash_fetch_m): Improve KeyError message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): putenv on msvcrt.dll can't remove empty value.wanabe2010-04-251-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_aset): allow recursive key. [ruby-core:24648]nobu2010-03-171-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (Hash#merge doc): Added explanation for form with block.marcandre2010-03-061-3/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_select_bang): add #select! and keep_if to Hash.matz2010-03-031-0/+86
| | | | | | * hash.c (env_select_bang): ..and to ENV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (hash_update): always raise an exception when adding a newmame2010-02-161-0/+11
| | | | | | | | key during iteration. Traditionally, an exception was raised only when rehash occurs, but it may lead to difficult bug to reproduce. [ruby-core:23614] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_push_m, rb_ary_unshift_m, rb_ary_aset),nobu2010-02-101-0/+1
| | | | | | | | | | | | | | (rb_ary_insert, rb_ary_replace, rb_ary_concat), (rb_ary_uniq_bang, rb_ary_flatten_bang): check if frozen after wrong number of arguments but before TypeError. [ruby-core:28140] * hash.c (rb_hash_replace): ditto. * string.c (rb_str_replace): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: test unsetenv returns a value.akr2010-01-261-0/+4
| | | | | | | | | | | unsetenv is void in older BSDs (FreeBSD 6 and OpenBSD 4.5 at least). * hash.c (ruby_setenv): don't use the result of unsetenv if unsetenv doesn't return a value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: need to include errno.h for EINVAL.usa2010-01-121-1/+2
| | | | | | | * hash.c (ruby_setenv): fixed typo. see [ruby-dev:40026] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): Improve the emulatation of setenv(3) onknu2010-01-111-2/+16
| | | | | | | | | environments where putenv(3) is used. Raise EINVAL If a variable name contains an '='. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): ENV.[]= should raise an error if setenv(3)knu2010-01-111-5/+9
| | | | | | | | or putenv(3) fails. [ruby-dev:40023] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): get rid of crash in Solaris 8 and 10.nobu2009-11-141-1/+27
| | | | | | | [ruby-core:26668] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): use ruby_strdup().nobu2009-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (ruby_setenv): also set CRT workarea. ref [ruby-core:25010]usa2009-11-111-18/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: use RHASH_IFNONE but not ifnone directly.nobu2009-11-081-14/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (default_proc_arity_check): new support function.matz2009-10-261-7/+15
| | | | | | | * hash.c (rb_hash_initialize): should do arity check as #default_proc=. [ruby-core:26281] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_set_default_proc): checks arity of defalt_procmatz2009-10-241-0/+6
| | | | | | of a Hash. [ruby-core:26087] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_f_getenv): use rb_filesystem_str_new_cstrnaruse2009-09-281-2/+2
| | | | | | | | | | | | | | | | | | | instead of rb_str_new2. ENV['PATH'].encoding should be Filesystem Encoding because its content is related to filesystem. see [ruby-dev:39393] * hash.c (env_fetch): ditto. * string.c (rb_filesystem_str_new): defined. * string.c (rb_filesystem_str_new_cstr): ditto. * include/ruby/intern.h (rb_filesystem_str_new): added. * include/ruby/intern.h (rb_filesystem_str_new_cstr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_f_getenv, env_fetch): env string may be overwritten.nobu2009-09-281-3/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (Hash#each): Fix documentation to reflect insertion order. A patch ↵marcandre2009-09-241-3/+2
| | | | | | by Run Paint Run Run [ruby-core:23644] and [ruby-core:21231] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (doc): doc fix, patch by Run Paint Run Run [ruby-core:23644]marcandre2009-09-241-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_exec_recursive_outer, rb_exec_recursive): Added method to ↵marcandre2009-09-151-5/+5
| | | | | | | | | | | | | | | | | | short-circuit to the outermost level in case of recursion * test/ruby/test_thread.rb (test_recursive_outer): Test for above * hash.c (rb_hash_hash): Return a sensible hash for in case of recursion [ruby-core:24648] * range.c (rb_range_hash): ditto * struct.c (rb_struct_hash): ditto * array.c (rb_array_hash): ditto * test/ruby/test_array.rb (test_hash2): test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_replace): should copy compare_by_identity status as well.matz2009-08-031-0/+4
| | | | | | [ruby-core:24728] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (Hash::[]): rdoc. patch by Marc-Andre Lafortune.yugui2009-07-221-7/+11
| | | | | | #1385. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_aset, recursive_hash): rejects recursive hash.nobu2009-07-161-1/+4
| | | | | | | [ruby-core:22921] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ENV is now locale encoding.naruse2009-07-121-1/+1
| | | | | | | | * hash.c (env_str_new): use rb_locale_str_new instead of rb_tainted_str_new. rb_locale_str_new set string locale encoding and tainted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_hash): documentation fix. a patch frommatz2009-07-011-2/+2
| | | | | | | | | | | | | | Marc-Andre Lafortune. [ruby-core:23943] * object.c (rb_mod_cmp): ditto. * range.c (range_eq): ditto. * string.c (rb_str_partition, rb_str_rpartition): ditto. * struct.c (rb_struct_s_def): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_reject_bang): always check frozen status.matz2009-06-081-3/+5
| | | | | | | | | | | | | | [ruby-core:23715] * hash.c (rb_hash_update): ditto. * hash.c (rb_hash_reject_bang): call rb_hash_foreach() directly. * hash.c (rb_hash_update_i): call st_insert() directly. * hash.c (rb_hash_update_block_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (Init_Hash): made #to_s an alias to #inspect to reducenobu2009-05-291-13/+9
| | | | | | | | the result of recursive array. a patch from ujihisa at [ruby-core:23601]. [ruby-dev:38555] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_inspect): rescurses with defined ID to get ridnobu2009-05-291-8/+12
| | | | | | | of extra call. [ruby-core:23601] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e