summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-07io.c: rb_stderr_to_original_pnobu
* io.c (rb_stderr_to_original_p): hoist out the condition to write messages to the stderr FD directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07Added bundler for `test-bundled-gems` dependency.hsbt
rake, did_you_mean, test-unit depends on bundler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07prelude.rb: eliminate a private constantnobu
* prelude.rb (Thread.exclusive): eliminate a private constant, MUTEX_FOR_THREAD_EXCLUSIVE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07extmk.rb: exclude recursivelynobu
* ext/extmk.rb: exclude extension libraries recursively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07* 2018-01-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07doc/NEWS-2.5.0: Fix the description of backtrace format changemrkn
* The backtrace format change is affected by $stderr, but not STDERR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06Revert "net/protocol: use binary string buffers"normal
Oops, not ready, yet (will work on this tomorrow :x). This reverts commit r61638 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06net/ftp: fix FrozenError in BufferedSocketnormal
I noticed this bug while working on something else with RUBYOPT=-d on, existing test cases all passed with it. Note: I use String.new because it is the local style, here, I prefer +'' (or ''.b, for a future commit) * lib/net/ftp.rb (BufferedSocket#read): use String.new * test/net/ftp/test_buffered_socket.rb (test_read_nil): new test [ruby-core:84675] [Bug #14323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06net/protocol: use binary string buffersnormal
Not an encoding expert, but this seems necessary for the next change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06test_process.rb: skip not-found groupsnobu
* test/ruby/test_process.rb (test_execopts_gid): under some network configuration (maybe with Open Directory but disconnected temporarily), some groups may fail to find. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06string.c: out-of-bounds accessnobu
* string.c (rb_str_enumerate_lines): fix out-of-bounds access when record separator is longer than the last element. [Bug #14257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06Update Status Codekazu
see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06Add 103 Early Hintskazu
see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06Specify frozen_string_literal: truekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05io.c: clear Strings we create for IO.copy_streamnormal
While we can't recycle strings after giving them rb_funcall*, we can reduce their malloc overhead by resizing them to zero. This only affects cases where either `src' or `dst' is a non-IO object and either `copy_length' is passed or there is pre-existing data in the read buffer. * io.c (copy_stream_fallback_body): clear when done with `copy_length' (copy_stream_body): clear when done with pre-existing read buffer git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05zlib: reduce garbage on gzip writes (deflate)normal
Zlib::GzipWriter generated large amounts of garbage from (struct zstream).input. Reuse the .input field when it is hidden, and recycle it when its lifetime is over. This change alone reduced memory usage of the writer from 90MB to 4.5MB. For the detached buffer of compressed data used by gzfile_write_raw, we can only clear the string (not recycle it) since user code may hold references to it (but the data would be clobbered, anyways). This reduced memory usage slightly by around 0.5MB (because it's smaller compressed data). Combined, these changes reduce the anonymous RSS memory of a dedicated writer process from over 90MB to under 4MB. before: # user system total real writer 7.823332 0.053333 7.876665 ( 7.881464) writer RssAnon: 92944 kB reader 6.969999 0.076666 7.046665 ( 7.906377) reader RssAnon: 109820 kB after: writer 7.359999 0.000000 7.359999 ( 7.360639) writer RssAnon: 4040 kB reader 6.346667 0.070000 6.416667 ( 7.387654) reader RssAnon: 98272 kB Script used: ------- require 'zlib' require 'benchmark' nr = 16384 * 2 def stats(pfx, bm) str = "#{bm}#{File.readlines("/proc/#$$/status").grep(/^RssAnon:/)[0]}" puts str.gsub!(/^/m, pfx) end rd, wr = IO.pipe pid = fork do buf = ((0..255).map(&:chr).join * 128).freeze rd.close gzip = Zlib::GzipWriter.new(wr) bm = Benchmark.measure do nr.times { gzip.write(buf) } gzip.close wr.close end stats('writer ', bm) end wr.close buf = '' gunzip = Zlib::GzipReader.new(rd) n = 0 bm = Benchmark.measure do begin gunzip.readpartial(16384, buf) n += buf.size rescue EOFError break end while true end stats('reader ', bm) Process.waitall ------- * ext/zlib/zlib.c (zstream_discard_input): reuse or recycle hidden input (zstream_reset_input): clear hidden input (zstream_run): detach input and recycle after use (gzfile_write_raw): clear buffer after write [ruby-core:84638] [Feature #14315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Extend timeout of test_clear_unreachable_keyword_argsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Show how many seconds it timeoutsnaruse
By this we can easily extend timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05extend timeout to 15 seconds for ARMv8 environmentnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Speedup `Proc#call` [Feature #14318]ko1
* vm_insnhelper.c (vm_call_opt_call): do same process of `yield` instead of invoking `Proc`. * vm_insnhelper.c (vm_invoke_block): invoke given block handler instead of using a block handler in the current frame. Also do not check blcok handler here (caller should check it). * insns.def (invokeblock): catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05parse.y: Use nd_set_loc instead of direct modification to nd_locmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05parse.y: Remove unneeded codemame
Because block_append sets prelude->nd_loc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05parse.y: make method_add_block accept locationmame
Also, use method_add_block instead of direct modification to nd_iter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05* 2018-01-06svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node_h (NEW_DEFN): remove unused argumentmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05compile.c: fix stack consistency errornobu
* compile.c (iseq_peephole_optimize): fix stack consistency error from return in loop, by adding extra `pop` when replacing `jump` with `leave`, which is never reached but needed to adjust sp calculation. [ruby-core:84589] [Bug #14273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05compile.c: remove more unreachable chunknobu
* compile.c (remove_unreachable_chunk): remove beyond labels to be removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05marshal.c: allow marshalling keyword_init structk0kubun
struct.c: define rb_struct_s_keyword_init to shared with marshal.c internal.h: add the declaration to be used by marshal.c test/ruby/test_marshal.rb: add test for Bug#14314 [Feature #14314] [ruby-core:84629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.c: factor out the part of operator output into F_OPERATORmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.c: remove unused macro F_OPTIONmame
Follow up of r61610 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.c (NODE_OP_CDECL): fix a typo bug.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05zlib: remove redundant rb_obj_revealnormal
No need to reveal strings freshly created with rb_str_new. * ext/zlib/zlib.c (zstream_detach_input): remove redundant call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05tool/rbinstall.rb: allow owner to have write permissionsnormal
Denying write permissions to the owner seems wrong. Oddly, this problem only manifests in the "ruby_2_4" branch when installing bundled gems (rake and friends). It does not happen with "ruby_2_3", or "trunk", so it might be related to RubyGems changes. * tool/rbinstall.rb: set umask to 022 [ruby-core:84420] [Bug #14227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.h: remove NODE_PRELUDEmame
NODE_PRELUDE contains a `BEGIN` node, a main node, and compile_option. This node is assumed that it must be located immediately under the root NODE_SCOPE, but this strange assumption is not so good, IMO. This change removes the assumtion; it integrates the former two nodes by block_append, and moves compile_option into rb_ast_body_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05make rb_iseq_new* accept rb_ast_body_t instead of NODE*mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.h: define rb_ast_body_t and restructure rb_ast_tmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05node.c: constify NODE* arguments in node.cmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05* insns.def (invokeblock): `calling->recv` is not used.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Try to fix Travis CI configuration.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05parse.y: refactor out ast generation code of two rb_parser_compile_*mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05check array for zsuper. [Bug #14279]ko1
* compile.c (iseq_compile_each0): for zsuper (NODE_ZSUPER), we need to check given argument is Array or not. * test/ruby/test_super.rb: add a test for this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05net/protocol: optimize large read casenormal
There are several places where rbuf_consume is called with @rbuf.size as its length arg; simplify that case by avoiding the slow String#slice! operation in favor of a lightweight replacement. The following script exhibits reduced memory usage and runtimes using the time(1) command: 2.9s => 2.6s 70MB => 12 MB --------- require 'net/http' require 'digest/md5' Thread.abort_on_exception = true s = TCPServer.new('127.0.0.1', 0) len = 1024 * 1024 * 1024 th = Thread.new do c = s.accept c.readpartial(16384) c.write("HTTP/1.0 200 OK\r\nContent-Length: #{len}\r\n\r\n") IO.copy_stream('/dev/zero', c, len) c.close end addr = s.addr Net::HTTP.start(addr[3], addr[1]) do |http| http.request_get('/') do |res| dig = Digest::MD5.new res.read_body { |buf| dig.update(buf) # String#clear is important to reduce malloc overhead, # but most Ruby programmers don't do this :< buf.clear } puts dig.hexdigest end end ---------- * lib/net/protocol (rbuf_consume): optimize for @rbuf.size == len [Feature #14268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Refactor ISEQ_TYPE_DEFINED_GUARD outmame
This commit removes ISEQ_TYPE_DEFINED_GUARD because it is no longer needed. And this introduces ISEQ_TYPE_PLAIN which means that the iseq does nothing special but just wrap an expression. Currently, this is used for once execution: `/foo#{ bar }baz/o`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05* 2018-01-05svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05compile.c: refactoring of defined? exception handlermame
This commit removes tmp_node trick to create a special exception handler for `defined?`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04test/ruby/test_io.rb: relax RLIMIT_NPROC for invocation of rubymame
This limit seems to be too restrict. It sometimes produces the following warning when running `make test-all`: ``` TestIO#test_close_on_exec<main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04node.h: add NODE_ONCE instead of reuse of NODE_SCOPEmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04suppress warnings for long string literalsshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04define NO_LONG_LONG appropriatelyshyouhei
as documented above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04ULL suffix is a C99ismshyouhei
Don't assume long long == 8 bytes. If you can assume C99, there are macros named UINT64_C and such for appropriate integer literal suffixes. If you can't, no way but do a bitwise or. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e