summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2015-03-24fs.c: use statfs/statvfsnobu
* ext/-test-/file/fs.c (get_fsname): return filesystem name by statfs/statvfs. [ruby-core:68624] [Bug #10998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-21console.c: winsize on Windowsnobu
* ext/io/console/console.c (console_set_winsize): use handle for writing. GetConsoleScreenBufferInfo seems failing on a handle for reading. * io.c: [DOC] update the example of IO#winsize to use $stdout instead of $stdin, which does not work on Windows. a patch by Jan Lelis <mail AT janlelis.de> at [ruby-core:68574]. [Bug #10986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-13stringio.c: don't raise after closenobu
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-13libff: fix enable-shared conditionnobu
* ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [ruby-dev:48901] [Bug #10960] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12accept_nonblock: favor rb_hash_lookup2 to avoid Hash#defaultnormal
* ext/socket/init.c (rsock_s_accept_nonblock): use rb_hash_lookup2 * ext/openssl/ossl_ssl.c (get_no_exception): new function (ossl_ssl_accept_nonblock): use get_no_exception (ossl_ssl_read_internal): ditto (ossl_ssl_write_nonblock): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12ext/openssl/ossl_ssl.c: predefine wait_*able symbolsnormal
This leads to a size reduction in openssl.so and reduces the chance of bugs due to typos. text data bss dec hex before: 333022 13164 3312 349498 5553a after: 332790 13164 3232 349186 55402 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12accept_nonblock supports "exception: false"normal
This is analogous to functionality found in IO#read_nonblock and IO#wait_nonblock. Raising exceptions for common failures on non-blocking servers is expensive and makes $DEBUG too noisy. Benchmark results: user system total real default 2.790000 0.870000 3.660000 ( 3.671597) exception: false 1.120000 0.800000 1.920000 ( 1.922032) exception: false (cached arg) 0.820000 0.770000 1.590000 ( 1.589267) --------------------- benchmark script ------------------------ require 'socket' require 'benchmark' require 'tmpdir' nr = 1000000 Dir.mktmpdir('nb_bench') do |path| sock_path = "#{path}/test.sock" s = UNIXServer.new(sock_path) Benchmark.bmbm do |x| x.report("default") do nr.times do begin s.accept_nonblock rescue IO::WaitReadable end end end x.report("exception: false") do nr.times do begin s.accept_nonblock(exception: false) rescue IO::WaitReadable abort "should not raise" end end end x.report("exception: false (cached arg)") do arg = { exception: false } nr.times do begin s.accept_nonblock(arg) rescue IO::WaitReadable abort "should not raise" end end end end end * ext/socket/init.c (rsock_s_accept_nonblock): support exception: false [ruby-core:66385] [Feature #10532] * ext/socket/init.c (rsock_init_socket_init): define new symbols * ext/socket/rubysocket.h: adjust prototype * ext/socket/socket.c (sock_accept_nonblock): support exception: false * ext/openssl/ossl_ssl.c (ossl_ssl_accept_nonblock): ditto * ext/socket/socket.c (Init_socket): adjust accept_nonblock definition * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto * ext/socket/tcpserver.c (rsock_init_tcpserver): ditto * ext/socket/unixserver.c (rsock_init_unixserver): ditto * ext/socket/tcpserver.c (tcp_accept_nonblock): adjust rsock_s_accept_nonblock call * ext/socket/unixserver.c (unix_accept_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_start_ssl): support no_exception * ext/openssl/ossl_ssl.c (ossl_ssl_connect): adjust ossl_start_ssl call * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto * test/socket/test_nonblock.rb (test_accept_nonblock): test for "exception :false" * test/socket/test_tcp.rb (test_accept_nonblock): new test * test/socket/test_unix.rb (test_accept_nonblock): ditto * test/openssl/test_pair.rb (test_accept_nonblock_no_exception): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* internal.h: use T_IMEMO to represent `struct MEMO' value.ko1
memo->v1 and memo->v2 is WB protected values. So use MEMO_V1/V2_SET() macros to set these values. memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer value), so use gc_mark_maybe() in gc.c to mark it. Rename NEW_MEMO() to MEMO_NEW(). Move MEMO_FOR and NEW_MEMO_FOF macros from node.h. Export a rb_imemo_new() function for ext/ripper. * node.h: remove NODE_MEMO. * enum.c: catch up these change. * enumerator.c: ditto. * load.c: ditto. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c (gc_mark_children): mark imemo_memo type. * parse.y (new_args_gen): use T_IMEMO. (I'm not sure it is working correctly...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* node.h: remove NODE_IFUNC, NEW_IFUNC.ko1
* internal.h: use T_IMEMO for IFUNC. rename `struct IFUNC' to `struct vm_ifunc' and move the definition from vm_insnhelper.h. Add imemo_ifunc. * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object. * compile.c: catch up these changes. * proc.c: ditto. * vm_core.h (RUBY_VM_IFUNC_P): ditto. * vm_eval.c (rb_iterate): ditto. * vm_insnhelper.c: ditto. * ext/objspace/objspace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* include/ruby/ruby.h: introduce new type T_IMEMO.ko1
T_IMEMO is Internal Memo type, internal use only. T_IMEMO has same purpose of NODE_MEMO. To insert T_IMEMO, type numbers are modified a little. * internal.h: define struct RIMemo. Each RIMemo objects has imemo_type. We can observe it by the imemo_type() function. * gc.c (rb_imemo_new): added. * node.h: remove NODE_CREF and NEW_CREF(). * node.c (rb_gc_mark_node): ditto. * vm.c (vm_cref_new): use rb_imem_new(). * vm_eval.c: ditto. * vm_eval.c (eval_string_with_cref): * vm_eval.c (rb_type_str): * vm_insnhelper.c: use RIMemo objects for CREF. * ext/objspace/objspace.c: support T_IMEMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-09stringio.c: don't raise after closenobu
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* ext/zlib/zlib.c (rb_gzfile_close): Don't raise on doubleakr
close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01io/wait: fix return value for buffered readnormal
* ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX Thanks to Yura Sokolov <funny.falcon@gmail.com> [ruby-core:68369] [Bug#10923] * test/io/wait/test_io_wait.rb (test_nread_buffered): fix broken test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-27* ext/pty/pty.c: AIX supports autopush. Patch by Perry Smith ↵odaira
[ruby-core:58539] [Bug #9144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-27thread.c: refine enumsnobu
* ext/thread/thread.c: remove unnecessary enum values and add end of enumerations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-25* ext/win32/Win32API.rb (initialize): accept both a string and an arrayusa
for the arguments of the imported function. reported by Aaron Stone [ruby-core:68208] [Bug #10876] [Fixes GH-835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-21ossl_bn.c: [DOC] expand rdocs [ci skip]nobu
* ext/openssl/ossl_bn.c: [DOC] expand rdocs as RDoc does not expand C-preprocessor macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-21ossl_asn1.c: fix docnobu
* ext/openssl/ossl_asn1.c (ossl_asn1obj_get_oid): [DOC] fix notation, an instance method but not a class method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-21[DOC] Backport ruby/openssl@86eb721 [ci skip]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-17* ext/psych/lib/psych.rb: bump psych version.tenderlove
* ext/psych/psych.gemspec: ditto * ext/psych/yaml/scanner.c: add latest libyaml change. * test/psych/helper.rb: support newer minitest * test/psych/test_to_yaml_properties.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16use rb_funcallvnobu
* use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: use static IDsnobu
* ext/io/console/console.c (rawmode_opt): prepare static IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: avoid inadvertent pindownnobu
* ext/io/console/console.c (console_dev): call Kernel#__send__ method to avoid inadvertent pindown. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: fix typonobu
* ext/io/console/console.c (console_dev): fix typo, should be rb_funcallv to call with an argument array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-13coverage.c: suppress a warningnobu
* ext/coverage/coverage.c (coverage_clear_result_i): use local variable coverage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-13* ext/coverage/coverage.c: Add Coverage.peek_result. Allows you totenderlove
capture coverage information without stopping the coverage tool. [ruby-core:67940] [Feature #10816] * test/coverage/test_coverage.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-13* ext/json: merge upstream from flori/jsonhsbt
change usage of TypedData. [Feature #10739][ruby-core:67564] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-12openssl: check RAND_edg to support libresslnobu
* ext/openssl/extconf.rb: check RAND_edg to support libressl. * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg is available. [Fix GH-829] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11md5init.c: fix a typonobu
* ext/digest/md5/md5init.c: fix a typo, remove an extra underscore from a macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11digest: CommonDigestnobu
* ext/digest/digest_conf.rb (digest_conf): check for CommonDigest. * ext/digest/*/*cc.h: for Apple CommonCrypto/CommonDigest.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11digest: define Finish func from Final funcnobu
* ext/digest/digest.h (DEFINE_FINISH_FUNC_FROM_FINAL): macro for finish functions, by inverting arguments order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11digest: common configurationsnobu
* ext/digest/digest_conf.rb (digest_conf): extract common configurations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-11generator.c: fix infinite recursionnobu
* ext/json/generator/generator.c (generate_json): get rid of unnecessary recursive calls which can cause infinite recursion. T_STRING may not have rb_cString. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-10digest: no ID cachenobu
* ext/digest/*/*init.c: no need to cache interned IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08getaddrinfo.c: GHOST vulnerability checknobu
* ext/socket/getaddrinfo.c (get_addr): reject too long hostname to get rid of GHOST vulnerability on very old platforms. * ext/socket/raddrinfo.c (make_hostent_internal): ditto, paranoic check for the canonnical name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08registry.rb: wide versionsnobu
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide versions of RegDeleteValue and RegDeleteKey. [ruby-core:67958] [Bug #10820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08socket/extconf.rb: reduce duplicated codenobu
* ext/socket/extconf.rb: reduce duplicated code. set fallback value first, then check OS-provided functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06* ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes whentenderlove
dumping objects with custom coders. [ruby-core:66215] [Bug #10496] * test/psych/test_coder.rb: test for fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06* ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regulartenderlove
expressions with newlines. tenderlove/psych#222 * test/psych/test_yaml.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04* ext/win32ole/win32ole.c (Init_win32ole): should not use atexit tosuke
free allocated hash table to avoid error on Cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04_sdbm.c: fix pointers to shiftnobu
* ext/sdbm/_sdbm.c (delpair): dst and src point at the ends of each data, whereas memmove requires pointers to the beginnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04bigdecimal.c: format specifiersnobu
* ext/bigdecimal/bigdecimal.c (VpInit, VpPower, VpVarCheck): fix format specifiers of BDIGIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04bigdecimal.c: fix a typonobu
* ext/bigdecimal/bigdecimal.c (VpSetPTR): fix a typo, 'expoennt' to 'exponent'. [ruby-core:67980] [Bug #10823] [Fix GH-825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-04_sdbm.c: ruby/ruby.h for PRIdPTRDIFFnobu
* ext/sdbm/_sdbm.c: include ruby/ruby.h for PRIdPTRDIFF when a macro `DEBUG` is defined. based on the patch by Owen Rodley in [ruby-core:67987]. [Bug #10825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-29* ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback functionmrkn
for rubies lower than 2.2.0. * ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto. * ext/bigdecimal/extconf.rb: check the existences of struct RRational, rb_rational_num, and rb_rational_den. * ext/bigdecimal/bigdecimal.bundle: bump version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-28* ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes withtenderlove
instance variables when it is referenced multiple times. * ext/psych/lib/psych.rb: bump version * ext/psych/psych.gemspec: bump version * test/psych/test_hash.rb: test for fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-27cstr.c: nil iff terminated validlynobu
* ext/-test-/string/cstr.c (bug_str_cstr_term_char): return nil only when terminated validly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-26cstr.c: cstr_term_char class methodnobu
* ext/-test-/string/cstr.c (bug_str_s_cstr_term_char): add a class method to see plain Strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-26cstr.c: get rid of exceptionnobu
* ext/-test-/string/cstr.c (bug_str_cstr_term_char): get rid of invalid byte sequence exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-24libffi: workaround of VC12 mlnobu
* ext/fiddle/win32/libffi.mk.tmpl: assemble without directory prefix. workaround of a bug of VC12 ml, by unak at [ruby-core:67792]. [ruby-core:67789] [Bug #10780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e