summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-08-15ossl_ssl.c: check SSL method namenobu
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): SSL method name must not contain NUL. preserve the encoding of message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15use assert_raisenobu
* test/openssl/test_ssl.rb: use assert_raise instead of a deprecated method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15use rb_sym2strnobu
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): use rb_sym2str to get rid of inadvertent ID creations. * ext/socket/ancdata.c (ancillary_inspect): ditto. * ext/socket/option.c (sockopt_inspect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15range.c: call range_include directly if possiblenobu
* range.c (range_eqq): trivial optimization to jump to range_include directly if the method is not redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15win32/registry.rb: size in bytesnobu
* ext/win32/lib/win32/registry.rb (API#SetValue): data size should be in bytes, not in chars. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15io.c: read more datanobu
* io.c (rb_io_each_codepoint): read more data when read partially. [ruby-core:70379] [Bug #11444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14hash.c: improve integer/fixnum hashingnormal
The low bits of Ruby object IDs are rarely populated in the current implementation, so ensure the get used. Early versions of this patch redundantly shifted static symbols in any_hash, causing regresions with static symbols in hash_aref_sym * hash.c (any_hash): skip rb_objid_hash for static syms (rb_num_hash_start): extract from rb_ident_hash (rb_objid_hash): call rb_num_hash_start (rb_ident_hash): ditto [ruby-core:70181] [Feature #11405] target 0: a (ruby 2.3.0dev (2015-07-30 trunk 51437) [x86_64-linux] target 1: b (ruby 2.3.0dev (2015-07-30 patch 51437) [x86_64-linux] benchmark results from Xeon E3-1230 v3 @ 3.30GHz (turbo disabled): minimum results in each 10 measurements. Execution time (sec) name a b hash_aref_dsym 0.316 0.300 hash_aref_dsym_long 5.106 5.063 hash_aref_fix 0.304 0.297 hash_aref_flo 0.061 0.060 hash_aref_miss 0.433 0.430 hash_aref_str 0.408 0.396 hash_aref_sym 0.312 0.306 hash_aref_sym_long 0.482 0.469 hash_flatten 0.385 0.273 hash_ident_flo 0.036 0.037 hash_ident_num 0.277 0.276 hash_ident_obj 0.291 0.284 hash_ident_str 0.289 0.286 hash_ident_sym 0.285 0.281 hash_keys 0.269 0.271 hash_shift 0.020 0.016 hash_values 0.264 0.264 loop_whileloop2 0.101 0.099 vm2_bighash* 3.066 2.972 Speedup ratio: compare with the result of `a' (greater is better) name b hash_aref_dsym 1.052 hash_aref_dsym_long 1.008 hash_aref_fix 1.024 hash_aref_flo 1.015 hash_aref_miss 1.007 hash_aref_str 1.031 hash_aref_sym 1.018 hash_aref_sym_long 1.027 hash_flatten 1.410 hash_ident_flo 0.994 hash_ident_num 1.001 hash_ident_obj 1.022 hash_ident_str 1.012 hash_ident_sym 1.016 hash_keys 0.992 hash_shift 1.237 hash_values 1.001 loop_whileloop2 1.013 vm2_bighash* 1.032 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14iseq.c (rb_iseq_mark): reduce NULL checksnormal
iseq_location_setup always sets path, label and base_label fields, and the only caller of iseq_location_setup (prepare_iseq_build) will always pass non-nil `name' and `path' arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14* 2015-08-15svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14ChangeLog: add reference for r51576 [ci skip]normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14thread_pthread.c: suppress a warningnobu
* thread_pthread.c (native_stop_timer_thread): explicit type of old value to suppress a pointer-sign warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14method.h: cast checks to int for >= 0 checksnormal
Setting VM_CHECK_MODE to 1 in vm_core.h makes noisy warnings otherwise. AFAIK, the signedness of enums is implementation-dependent, and GCC considers them unsigned and warns. Tested on gcc 4.7.2 (Debian 4.7.2-5) * method.h (METHOD_ENTRY_VISI_SET): cast visi to int (METHOD_ENTRY_FLAGS_SET): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14improve handling of timer thread shutdownnormal
Shutting down the timer thread now always closes pipes to free FDs. In fact, we close the write ends of the pipes is done in the main RubyVM to signal the timer thread shutdown. To effectively close pipes, we implement userspace locks via atomics to force the pipe closing thread to wait on any signal handlers which may be waking up. While we're at it, improve robustness during resource exhaustion and allow it to limp along non-fatally if restarting a timer thread fails. This reverts r51268 Note: this change is tested with VM_CHECK_MODE 1 in vm_core.h * process.c (close_unless_reserved): add extra check (dup2_with_divert): remove (redirect_dup2): use dup2 without divert (before_exec_non_async_signal_safe): adjust call + comment (rb_f_exec): stop timer thread for all OSes (rb_exec_without_timer_thread): remove * eval.c (ruby_cleanup): adjust call * thread.c (rb_thread_stop_timer_thread): always close pipes * thread_pthread.c (struct timer_thread_pipe): add writing field, mark owner_process volatile for signal handlers (rb_thread_wakeup_timer_thread_fd): check valid FD (rb_thread_wakeup_timer_thread): set writing flag to prevent close (rb_thread_wakeup_timer_thread_low): ditto (CLOSE_INVALIDATE): new macro (close_invalidate): new function (close_communication_pipe): removed (setup_communication_pipe_internal): make errors non-fatal (setup_communication_pipe): ditto (thread_timer): close reading ends inside timer thread (rb_thread_create_timer_thread): make errors non-fatal (native_stop_timer_thread): close write ends only, always, wait for signal handlers to finish (rb_divert_reserved_fd): remove * thread_win32.c (native_stop_timer_thread): adjust (untested) (rb_divert_reserved_fd): remove * vm_core.h: adjust prototype git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14win32/registry.rb: terminator sizenobu
* ext/win32/lib/win32/registry.rb (API#SetValue): add terminator size, not 1 byte. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14win32/registry.rb: make @@type2name an arraynobu
* ext/win32/lib/win32/registry.rb (@@type2name): make an array instead of a hash, keys are sequential numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14* 2015-08-14svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14test_ssl_session.rb: check SSL methodnobu
* test/openssl/test_ssl_session.rb (test_ctx_server_session_cb): ensure the method to be tested is supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13test/rubygems: clear hooksnobu
* test/rubygems/test_gem_commands_pristine_command.rb (setup): clear post_install hook to fix failures when running parallel to test_gem_commands_install_command.rb with -j option. * test/rubygems/test_gem_commands_uninstall_command.rb (setup): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13timeout.rb: freeze a string messagenobu
* lib/timeout.rb (Timeout#timeout): freeze a string message to reduce string allocations. [Fix GH-996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13* vm_core.h (rb_call_info_kw_arg_bytes): move the definitionko1
to iseq.h because this function is shared with iseq.c and compile.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13thread.c: freeze masksnobu
* thread.c (rb_thread_s_handle_interrupt, rb_uninterruptible): freeze mask hashes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13object.c: rb_num_to_dblnobu
* object.c (rb_num_to_dbl): move from num2dbl_with_to_f in math.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13id_table.c: TOKEN_PASTEnobu
* id_table.c (IMPL1): use TOKEN_PASTE, and prevent `op' from expansion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13defines.h: tweaks of function alias macrosnobu
* include/ruby/defines.h (RUBY_ALIAS_FUNCTION_TYPE): cast the result to suppress warnings. * include/ruby/defines.h (RUBY_ALIAS_FUNCTION_VOID): minimize if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13test_gc.rb: dump hung up processnobu
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): kill hung up process by SIGSEGV to dump the backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-13load.c (features_index_add): avoid repeat calculationnormal
Reduce cognitive overhead, eye strain and keep lines less than 80 columns to benefit users of giant fonts (honestly I prefer 64 column wrap :P). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* 2015-08-13svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12load.c: match comment with variable (`e' => `ext') [ci skip]normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12test_gc.rb: abort hung up processnobu
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): abort hung up process to dump the backtrace instead of terminating. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12id_table.c: prefix firstnobu
* id_table.c (IMPL): prepend id_table to the argument before its expansion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* id_table.c: IMPL() macro accept op as _opname instead of opnameko1
because jemalloc seems to replace the word `free' to `je_free'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* id_table.c (mix_id_table_insert): fix memory leak.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12iseq.c (iseq_memsize): reimplement for wrappernormal
* iseq.c (iseq_memsize): reimplement for wrapper (param_keyword_size): extracted from iseq_memsize (iseqw_mark): new mark function (iseqw_data_type): new data type (iseqw_new): wrap as iseqw_data_type (iseqw_check): adjust for wrapper (Init_ISeq): remove iseqw_iseq_key initialization * test/objspace/test_objspace.rb: new test [ruby-core:70344] [Feature #11435] v2 changes: - added RUBY_TYPED_WB_PROTECTED and write barrier - account for rb_call_info_kw_arg_t entries git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12hoist out rb_call_info_kw_arg_bytes to inline functionnormal
* vm_core.h (rb_call_info_kw_arg_bytes): extract from compile.c * compile.c (iseq_build_callinfo_from_hash): use above function This will be use for implementing iseq_memsize git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* class.c (move_refined_method): same as the last commit.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* class.c, gc.c vm.c: use ID_TABLE_* instead of ST_*ko1
(such as ST_CONTINUE) for enum rb_id_table_iterator_result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12* id_table.h: introduce ID key table.ko1
[Feature #11420] This table only manage ID->VALUE table to reduce overhead of st. Some functions prefixed rb_id_table_* are provided. * id_table.c: implement rb_id_table_*. There are several algorithms to implement it. Now, there are roughly 4 types: * st * array * hash (implemented by Yura Sokolov) * mix of array and hash The macro ID_TABLE_IMPL can choose implementation. You can see detailes about them at the head of id_table.c. At the default, I choose 34 (mix of list and hash). This is not final decision. Please report your suitable parameters or your data structure. * symbol.c: introduce rb_id_serial_t and rb_id_to_serial() to represent ID by serial number. * internal.h: use id_table for method tables. * class.c, gc.c, marshal.c, vm.c, vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12test_gc.rb: timeout of test_interrupt_in_finalizernobu
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): leave timeout to invoke_ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-12envutil.rb: abort at timeoutnobu
* test/lib/envutil.rb (invoke_ruby): abort at timeout and show the backtrace of the target process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11* 2015-08-12svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11rb_parser_compile_*: remove volatile argnormal
RB_GC_GUARD is sufficient to prevent tail call optimization from making the object invisible from GC., and we don't need to encourage more volatile usage. * parse.y (rb_parser_compile_cstr): remove volatile arg (rb_parser_compile_string): ditto (rb_parser_compile_file): ditto (rb_parser_compile_string_path): ditto (rb_parser_compile_file_path): ditto [ruby-core:70323] [Misc #11431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11* numeric.c (Init_Numeric): Fix document for Float::MIN andakr
Float::EPSILON. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11ruby.h: check integer overflownobu
* include/ruby/ruby.h (ALLOCV_N): check integer overflow, as well as ruby_xmalloc2. pointed out by Paul <pawlkt AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11array.c: fix buffer sizenobu
* array.c (rb_ary_repeated_permutation): fix buffer size, ALLOCV_N already multiplies element size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11* test/openssl/test_ssl.rb: Fix LocalJumpErrors being raisedhsbt
in OpenSSL tests. [ruby-core:70020][Bug #11368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11* string.c: Fix documentation for String#slicehsbt
[ruby-core:70298][Bug #11427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11parse.y: optional superclassnobu
* parse.y (superclass): make superclass rule optional and allow any contents without a terminator. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-11* string.c: [DOC] Make #end_with? example doc symmetryhsbt
with #start_with? [fix GH-992][ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e