summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-07-21* compile.c: constify the first parameter (iseq).ko1
* iseq_add_mark_object() * iseq_add_mark_object_compile_time() * iseq.c, iseq.h (rb_iseq_add_mark_object): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21test/socket/test_nonblock.rb: increase buffer sizes to OpenBSD limitsnormal
* test/socket/test_nonblock.rb: increase buffer sizes to OpenBSD limits. Thanks to Jeremy Evans <code@jeremyevans.net> [ruby-core:70058] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21load.c (ruby_dln_librefs): make staticnormal
This isn't used outside of load.c, so there appears to be no reason to expose it to other modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21fix typo in OptionParser#complete docs [ci skip]nobu
* lib/optparse.rb (complete): [DOC] fix typo. [Fix GH-973] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21test_process.rb: split a testnobu
* test/ruby/test_process.rb (test_execopts_popen): split into 3 tests, no other redirections, stdio, and other fds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20* 2015-07-21svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20io.c: IO.copy_stream uses poll on Linuxnormal
poll and ppoll have a superior API which doesn't require the kernel to scan a potentially large bitmap to find a high-numbered FD [ruby-core:35572]. So favor using poll in case IO.copy_stream encounters a non-blocking FD. We cannot reliably use poll on most OSes, because file types (e.g. FIFOs) which work with select may not work with poll. Fortunately, Linux uses a common notification mechanism between all select/poll/epoll variants, so all file types are equally supported between the notification mechanisms. Verified by watching strace on the following scripts: *** maygvl_copy_stream_wait_read *** require 'io/nonblock' r, w = IO.pipe r.nonblock = true IO.copy_stream(r, "/dev/null") *** nogvl_copy_stream_wait_write *** require 'io/nonblock' r, w = IO.pipe w.nonblock = true IO.copy_stream("/dev/zero", w) * io.c (nogvl_wait_for_single_fd): new function for Linux (maygvl_copy_stream_wait_read): Linux-specific version (nogvl_copy_stream_wait_write): use nogvl_wait_for_single_fd [ruby-core:70051] [Feature #11377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20parse.y (parser_initialize): avoid redundant zero-ingnormal
TypedData_Make_Struct already initializes fields to zero by default, so there's no need to waste code re-zeroing them. Size reduction on 32-bit x86: text data bss dec hex filename 187231 2372 80 189683 2e4f3 parse.o.before 186939 2372 80 189391 2e3cf parse.o git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20parse.y (ripper_initialize): fixup r51302normal
Missed eofp bitfield change in ripper_initialize in r51302 :x ("parse.y (struct parser_params): pack to 4 cache lines on x86-64") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20parse.y (struct parser_params): pack to 4 cache lines on x86-64normal
This reduces the struct from 256 (from 288) bytes on my x86-64 system, allowing the struct to fit cleanly into 4 cache lines (if a malloc implementation allows it). * parse.y (struct parser_params): pack: 88 => 256 bytes on 64-bit [ruby-core:70034] [Feature #11371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20thread.c: reuse tagnobu
* thread.c (rb_thread_terminate_all): reuse the tag pushed before a loop, instead of pushing/popping same tag repeatedly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-20ruby_vm_throw_flagsnobu
* vm_core.h (ruby_vm_throw_flags): constants for throw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19* 2015-07-20svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19thread.c: fix timeout limitnobu
* thread.c (ppoll): fix the limit, timeout argument of poll(2) is an int but not a time_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19pty.c: fix example typo [ci skip]nobu
* ext/pty/pty.c: [DOC] fix example typo, an old name at move from PTY.open. [Fix GH-972] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19* 2015-07-19svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-19eval.c: check tag valuenobu
* eval.c (rb_jump_tag): paranoiac check of tag value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18load.c: use TAG_RETURNnobu
* load.c (rb_require_internal): use TAG_RETURN not a magic number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18thread.c: gather common statementsnobu
* thread.c (vm_check_ints_blocking): gather common statements at the end, and prefer LIKELY for Visual C optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18load.c: reduce EXEC_TAGsnobu
* load.c (rb_load_internal0): do not raise any exceptions but return the result tag state. * load.c (rb_load_protect): reduce nested EXEC_TAGs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18gc.c: reduce EXEC_TAGsnobu
* gc.c (run_finalizer): set and restore safe level here to reduce nested EXEC_TAGs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18eval.c: extra conversion of exit statusnobu
* eval.c (ruby_cleanup): error_handle() returns exit status to the system, not internal error state, do not convert the exit status again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-18test/ruby/test_process.rb: test thread+sigs work after failed execnormal
Preparation for possible upcoming changes to timer thread. We need to ensure signal handling and thread scheduling works after an exec failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17test/socket/test_nonblock: use smaller buffer for sendmsgnormal
OpenBSD's limit is less than 128. * test/socket/test_nonblock: use smaller buffer for sendmsg Patch-by: Jeremy Evans <code@jeremyevans.net> [ruby-core:70016] [Bug #11364] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17signal.c (trap_handler): cleanup to use RSTRING_GETMEM + memcmpnormal
strncmp is unnecessary since the switch/case statement already checks length of the string; so use memcmp. This makes for a small reduction in binary size on 32-bit x86: text data bss dec hex filename 2847473 12360 30632 2890465 2c1ae1 ruby.before 2847313 12328 30632 2890273 2c1a21 ruby.after git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17* 2015-07-18svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17io.c (argf_read_nonblock): support `exception: false'normal
This is a preparation for [ruby-core:69892] ("io.c: avoid kwarg parsing in C API") since I noticed ARGF.read_nonblock did not properly catch up to the `exception: false' change. * io.c (argf_read_nonblock): support `exception: false' (io_nonblock_eof): new function (io_read_nonblock): use io_nonblock_eof (argf_getpartial): accept kwargs hash for `exception: false' * test/ruby/test_argf.rb (test_read_nonblock): new test [ruby-core:70000] [Feature #11358] * NEWS: add item for ARGF.read_nonblock git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17vm_eval.c: safe level 4nobu
* vm_eval.c (rb_eval_cmd): $SAFE=4 has been deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17compile.c: use ruby_tag_typenobu
* compile.c (iseq_compile_each): use enum ruby_tag_type names. * vm_core.h (ruby_tag_type): move from eval_intern.h for compiling break/next/redo/return. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17compile.c: remove unused bignobu
* compile.c (iseq_compile_each): remove unused big flag, `while` loop always leaves a result on the stack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17RUBY_VM_CHECK_INTS: eval the argument only oncenobu
* vm_core.h (RUBY_VM_CHECK_INTS): evaluate the argument only once to get rid of inadvertent side effects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17RUBY_VM_CHECK_INTS_BLOCKING: move to thread.cnobu
* thread.c (RUBY_VM_CHECK_INTS_BLOCKING): move from vm_core.h for the static function rb_threadptr_pending_interrupt_empty_p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17EXEC_EVENT_HOOK_ORIG: eval the arguments only oncenobu
* vm_core.h (EXEC_EVENT_HOOK_ORIG): evaluate each arguments only once to get rid of inadvertent side effects. fix use of `th` variable in the second `if` statement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17encoding.h: ENC_CODERANGE_CLEAN_Pnobu
* include/ruby/encoding.h (ENC_CODERANGE_CLEAN_P): predicate that tells if the coderange is clean, that is 7bit or valid, and no needs to scrub. * re.c (rb_reg_expr_str): use ENC_CODERANGE_CLEAN_P. * string.c (enc_strlen, rb_enc_cr_str_buf_cat, rb_str_scrub): ditto. * string.c (rb_str_enumerate_chars): ditto, and suppress a warning by gcc6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17test_range.rb: add Range#new testnobu
* test/ruby/test_range.rb (test_first_last): Add test for `Range.new`. [Fix GH-971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17test_range.rb: add Range#last assertionsnobu
* test/ruby/test_range.rb (test_first_last): Add assertions to test of `Range#last` with exclude_end true case. [Fix GH-970] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17thread.c (rb_thread_alone): simplifynormal
This function now also works in more places if ruby_current_thread is unset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-17remove unnecessary enumerator requiresnormal
* lib/rinda/tuplespace.rb: remove enumerator require * test/pathname/test_pathname.rb: ditto Related to https://bugs.ruby-lang.org/issues/10902 but not a complete fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16avoid redundant GET_THREAD() callsnormal
This reduces binary size slightly on my 32-bit system: text data bss dec hex filename 2847705 12360 30632 2890697 2c1bc9 ruby.orig 2847641 12360 30632 2890633 2c1b89 ruby * iseq.c (rb_iseq_compile_with_option): reuse result of previous GET_THREAD() call * thread.c (thread_create_core): ditto (rb_mutex_trylock): ditto (rb_mutex_lock): ditto * process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS * thread.c (rb_thread_check_ints): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16* 2015-07-17svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16thread.c (mutex_alloc): remove needless volatilenormal
Allocation functions do not do anything non-obvious to the compiler, so there's no reason for volatile here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16* vm_core.h: constify rb_iseq_t::parent_iseq.ko1
rb_iseq_t::local_iseq is not constant data because local_iseq::flip_cnt can be modified (commentted). * compile.c: catch up this fix. * iseq.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16* process.c (redirect_dup2): when the new FD of dup2() coflictsngoto
with one of the timer thread FDs, the internal FD is diverted. [Bug #11336] [ruby-core:69886] [Bug #11350] [ruby-core:69961] * process.c (dup2_with_divert): new function for the above purpose. * thread_pthread.c (rb_divert_reserved_fd): new function for diverting reserved FD. If the given FD is the same as one of the reserved FDs, the reserved FD number is internally changed. It returns -1 when error. Otherwise, returns 0. It also returns 0 if there is no need to change reserved FD number. * thread_win32.c (rb_divert_reserved_fd): always returns 0 because of no reserved FDs. * internal.h (rb_divert_reserved_fd): prototype declaration. It is Ruby internal use only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16* iseq.c (rb_iseq_disasm): rename rb_iseq_t *iseqdat to iseqko1
and VALUE *iseq to code. * iseq.c (rb_iseq_disasm_insn): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16string.c: remove redundant callsnobu
* string.c (rb_str_enumerate_lines): do not check if a block is given twice. RETURN_ENUMERATOR includes rb_block_given_p() check which is redundant here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16Revert r51209 because signals after stopping timer thread beforengoto
entering exec(2) system call may be lost. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16vm.c: fix mark with rewinding cfpnobu
* vm.c (REWIND_CFP): keep the arguments region inside the valid value stack. [ruby-core:69969] [Bug #11352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16vm.c: fix mark with rewinding cfpnobu
* vm.c (m_core_hash_merge_ptr): copy the arguments to the machine stack before rewinding the control frame pointer and leaving the arguments outside valid region of the value stack. [ruby-core:69969] [Bug #11352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16process.c (close_unless_reserved): declare type of `fd' argnormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e