* 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
* test/cgi/test_cgi_util.rb (CGIUtilTest): escape '<' not
ruby-mode.el to confuse with here documents.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: Fix a build problem with clang and --with-opt-dir.
If ruby is configured with --with-opt-dir=dir when using clang
as compiler, a warning `clang: warning: argument unused during
compilation: '-I dir'` is emitted almost every time clang
compiles a file. Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
any output from the compiler as fatal error, and the check thus
fails due to the warning. This is an attempt to fix the problem
by adding a flag -Qunused-arguments to CFLAGS locally in the
function to suppress the warning. [ruby-dev:48062] [Bug #9658]
[Fixes GH-571] https://github.com/ruby/ruby/pull/571
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
CSV to miss escaping some special meaning characters when used
in parsing.
Reported by David Unric
[ruby-core:54986] [Bug #8405]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
garbage_collect_with_gvl() here on non-ruby threads.
Should just ignore the malloc_increase.
This issue is pointed by Eric Wong [ruby-core:61519].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
constify a parameter (VALUE *).
I believe this incompatibility doesn't break any code.
However, if you have trouble, please tell us.
* eval.c, object.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (rb_method_entry_get_without_cache): get rid of
infinite recursion at aliases in a subclass and a superclass.
return actually defined class for other than singleton class.
[ruby-core:60431] [Bug #9475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/extconf.rb: check for -fno-defer-pop option, since clang
5.1 no longer support -fno-defer-pop option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We need to prevent vtm.zone from pointing to a GC-ed string buffer.
The rb_copy_generic_ivar call misses it because get_attr deleted it.
Thanks to nobu for the rb_str_new_frozen suggestion.
* time.c (time_mload): freeze and preserve marshal-loaded time zone
* test/ruby/test_time.rb: add test for GC on loaded object
[Bug #9652]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .gdbinit (rb_method_entry, rb_ancestors): `super` moved to
RClass from rb_classext_t since r44294.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
given. Related to [ruby-core:56099] [Bug #8662] and r42103.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/json/parser/prereq.mk (parser.c): use `enum` instead of
`static const int` to get rid of unused-const-variable warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c (nucomp_to_s): use rb_String.
* complex.c (nucomp_inspect): use rb_inspect.
* complex.c: use PRIsVALUE flag not to use an intermediate string
which can be collected by GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c, rational.c: remove unused functions, which are warned
by clang 5.1, and also variables only used by removed functions.
* ext/date/date_core.c: ditto.
* enc/utf_16be.c, enc/utf_16le.c: comment out constants only used
by commented out functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (os_version_style): get default style from
`/usr/bin/ruby` if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (DLDFLAGS): insert a space between option and its
argument for non-GCC compilers. [ruby-core:61429] [Bug #9624]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This hopefully works on all platforms with malloc_usable_size.
This may also trigger bugs in places which did not expect GC, too;
so maybe some existing code will need RB_GC_GUARD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
address. Therefore noreturn function with tail call's return
address may be in another function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (rb_add_method, rb_attr): cast between pointer and
ID via VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (DLDFLAGS): check for each options to control
symbol resolution. [ruby-core:61429] [Bug #9624]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
symbol table if it is built with cc -g and not stripped.
Now ruby can show static symbols on Linux though glibc's
backtrace_symbols(3) don't show them.
* addr2line.c (rb_dump_backtrace_with_lines): use dladdr(3) to
detect what object file declares the symbol because
dl_iterate_phdr can't detect the main executable file
and codes on the stack.
NOTE: signal trampolines sometimes on the user stack. (FreeBSD)
* addr2line.c (rb_dump_backtrace_with_lines): stop showing
backtrace if the function's name is main.
NOTE: FreeBSD's backtrace (libexecinfo) shows _start and
an additional address. Why it doesn't remove them on dladdr phase
is, dladdr may fail to detect the main function but detect
as _start function. Therefore it must be after scanning
the symbol table and getting correct name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
of backslash as well, patch by @idupree [Fixes GH-553] [ci skip]
https://github.com/ruby/ruby/pull/553
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e