summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2015-06-14* thread.c (thread_start_func_2): don't interrupt when last thread exitkosaki
unless main thread is already exited. Otherwise main thread could be wrongly interrupted when it uses rb_thread_call_without_gvl(). Patch by Takehiro Kubo. [Bug #11237][ruby-dev:49044][GH-898] * test/-ext-/gvl/test_last_thread.rb: new test for the above fix. * ext/-test-/gvl/call_without_gvl/call_without_gvl.c: new ext for the above test. * ext/-test-/gvl/call_without_gvl/extconf.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14* ext/pathname/lib/pathname.rb (descend): Blockless form supported.akr
(ascend): Ditto. [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14raddrinfo.c: suppress a warningnobu
* ext/socket/raddrinfo.c (parse_numeric_port): explict cast to suppress a warning for precision losing conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14* ext/socket/raddrinfo.c (parse_numeric_port): Detectakr
port overflow. (numeric_getaddrinfo): Use parse_numeric_port. numeric_getaddrinfo fails if port is too big now. This makes rb_getaddrinfo invokes the real getaddrinfo() on such condition. This change is related to [ruby-core:69355] [Bug #11179]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13* ext/io/console/depend (.list.chksum): revert a part of r50859, becauseusa
it was not mentioned at its commit log and it caused a build error on Windows ($(MAKE) is already quoted). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13* ext/openssl/ossl_ocsp.c: fix documentation on ocsp response cert status.hsbt
[fix GH-932] Patch by @chrisholmes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13* ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem.hsbt
[fix GH-929] Patch by @voxik * ext/io/console/io-console.gemspec: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13win32_vk.inc: suppress warningsnobu
* ext/io/console/depend (win32_vk.inc): use offsetof() to suppress warnings against cast from pointer to integer of different size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-12* ext/date/date_core.c: Grammar fix found by @aiperon [ci skip]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11* ext/zlib/zlib.c: Fix indentation for rdoc.hsbt
[Bug #11221][ruby-core:69465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05* ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignmentnormal
We call memset to zero `mh' a few lines above anyways, making explicitly zero-ing each field unnecessary. Compilers optimize this code away anyways, but it still costs me 4 lines of my small terminal and even smaller attention span. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05* ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments arengoto
parsed even on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL to prevent SEGV caused by passing Qnil to RARRAY_LENINT and to preserve behavior before r50776. [Bug #11224] [ruby-core:69468] [Bug #11225] [ruby-core:69469] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05ext/socket/ancdata.c (bsock_sendmsg_internal): portability fixnormal
* ext/socket/ancdata.c (bsock_sendmsg_internal): avoid msg_control ptr if msg_controllen is zero to fix portability problems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05ext/socket/ancdata.c (bsock_sendmsg_internal): fix build error from r50776normal
Systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL still need controls to be nil for the check after argument parsing. Note: not actually tested on a real system without msg_control git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_scan_argsnormal
This should make the code more maintainable and make it easier to add keyword argument support for "exception: false" in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04* ext/win32ole/win32ole.c: fix a typo. Patch by @davydovantonhsbt
[fix GH-923] * include/ruby/st.h: ditto. * include/ruby/util.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntlnormal
[ruby-core:69382] [Feature #11190] IO#nonblock= is easier-to-read, potentially more portable, and avoids redundantly setting flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* configure.in: Don't check __int128.akr
* ext/rbconfig/sizeof/extconf.rb: Check __int128. * ext/rbconfig/sizeof/depend: sizes.c depends on ext/rbconfig/sizeof/extconf.rb. * template/sizes.c.tmpl: Detect check_sizeof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01tkutil.c: fix out-of-bounds accessnobu
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check array length not access out-of-bounds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31ext/date/date_core.c: [DOC] fold long paragraphsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31[DOC] Decrease heading under DateTime [ci skip]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31tkutil.c: fix memory leak and segfaultnobu
* ext/tk/tkutil/tkutil.c (cbsubst_append_inf_key): extract a function append a key in subst info to a string. make result strings first and get rid of potential memory leak. * ext/tk/tkutil/tkutil.c (cbsubst_get_subst_arg): allocate the result buffer as a string to fix: * memory leak when the argument key is not found: loop {Tk::Event.subst_arg(:a) rescue nil} * buffer overflow segfault when many arguments: class T < TkUtil::CallbackSubst _setup_subst_table([[?a, ?A, :_a]], []) subst_arg(*[:_a]*1000).size end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31* ext/date/date_core.c: [DOC] Add comparison of Time and DateTimezzak
Patch provided by @pixeltrix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31tkutil.c: reduce unnecessary buffernobu
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): reduce unnecessary buffer. the result string is one byte per one word. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-30ext/socket/ancdata.c: use RB_GC_GUARD instead of volatilenormal
See doc/extension.rdoc for explanation. [ruby-core:69419] [Feature #11198] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29openssl: wrapper object before allocnobu
* ext/openssl: make wrapper objects before allocating structs to get rid of potential memory leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29psych: allocate structs with wrappernobu
* ext/psych/psych_emitter.c (allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. * ext/psych/psych_parser.c (allocate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29socket: avoid redundant fcntl on Linuxnormal
* ext/socket/ancdata.c (bsock_sendmsg_internal, bsock_recvmsg_internal): avoid redundant fcntl on Linux [ruby-core:69154] [Feature #11145] * ext/socket/init.c (rsock_s_recvfrom_nonblock): ditto * ext/socket/rubysocket.h (MSG_DONTWAIT_RELIABLE): new macro MSG_DONTWAIT is enough to force non-blocking I/O under Linux, so avoid changing the state of a socket. This will allow certain threads to do a non-destructive non-blocking "peek" while others block (without relying on an extra ppoll syscall). We shall be conservative about enabling this feature since some OSes may have incomplete support for MSG_DONTWAIT. I shall defer to a FreeBSD expert to enable that for FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28* ext/objspace/objspace.c: add two methods to debug internals.ko1
* ObjectSpace.internal_class_of: return RBASIC_CLASS(obj). * ObjectSpace.internal_super_of: return RCLASS_SUPER(cls). * NEWS: add information about both methods. * test/objspace/test_objspace.rb: add tests for both methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28generator.c: allocate structs with wrappernobu
* ext/json/generator/generator.c (cState_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28parser.rl: allocate structs with wrappernobu
* ext/json/parser/parser.rl (cJSON_parser_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28win32ole.c: wrapper object before allocnobu
* ext/win32ole/win32ole.c (Init_win32ole): make wrapper object before making st_table. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28tcltklib.c: allocate structs with wrappernobu
* ext/tk/tcltklib.c (ip_create_slave_core): allocate structs with making new wrapper objects and get rid of potential memory leak. * ext/tk/tkutil/tkutil.c (allocate_cbsubst_info): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28tkutil.c: check arguments typenobu
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): check arguments type. implicit conversion is disabled to get rid of method calls which can modify other arguments. * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): ditto. * ext/tk/tkutil/tkutil.c (cbsubst_scan_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28tkutil.c: check typenobu
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): ensure the result type of a method call to be an array before accessing by RARRAY macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27Fix typo in samples for tk ext [skip ci]nobu
* ext/tk/sample/figmemo_sample.rb (open_file), ext/tk/sample/tktextio.rb (TkTextIO): fix typo in messages. [Fix GH-916] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27tcltklib.c: fix memory leaknobu
* ext/tk/tcltklib.c (ip_init): reject already initialized interpreter to fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27bigdecimal.c: wrapper object before allocnobu
* ext/bigdecimal/bigdecimal.c (VpNewRbClass): make wrapper object before result structs allocation and manage refcount for each elements to get rid of potential memory leak. * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27openssl: use RB_GC_GUARD instead of volatilenormal
From doc/extension.rdoc: > > Using the RB_GC_GUARD macro is preferable to using the "volatile" > keyword in C. RB_GC_GUARD has the following advantages: > > 1) the intent of the macro use is clear > > 2) RB_GC_GUARD only affects its call site, "volatile" generates some > extra code every time the variable is used, hurting optimization. > > 3) "volatile" implementations may be buggy/inconsistent in some > compilers and architectures. RB_GC_GUARD is customizable for broken > systems/compilers without those without negatively affecting other > systems. * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode, ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile [ruby-core:69371] [Bug #11185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27ossl_asn1.c: [DOC] Fix typo [skip ci]nobu
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): [DOC] Fix typo "recieved" to "received". [Fix GH-913] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-21digest.c: GC guardnobu
* ext/digest/digest.c (hexencode_str_new, rb_digest_base_update): prevent argument strings from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18nonblock.c: just yield if the flag is not changednobu
* ext/io/nonblock/nonblock.c (io_nonblock_set): return whether nonblock flag was changed. * ext/io/nonblock/nonblock.c (rb_io_nonblock_block): nothing to restore but just yield unless nonblock flag is changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17notimplement: renamenobu
* ext/-test-/notimplement, test/-ext-/test_notimplement.rb: rename from bug-3662. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17ext/socket/init.c: use SOCK_NONBLOCK if availablenormal
This saves a system call by allowing us to use SOCK_NONBLOCK in Linux when accept4 is available. Note: I do not agree accept_nonblock should always make accepted sockets non-blocking, and will propose a future API to allow controlling whether accepted sockets are non-blocking or not regardless of how they were created. * ext/socket/init.c (cloexec_accept): support nonblock flag and use SOCK_NONBLOCK if possible * ext/socket/init.c (rsock_s_accept_nonblock): update cloexec_accept call * ext/socket/init.c (accept_blocking): ditto for blocking * test/socket/test_nonblock.rb: check nonblock? on accepted socket [Feature #11138] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16ifaddr.c: wrapper object before allocnobu
* ext/socket/ifaddr.c (rsock_getifaddrs): make wrapper object before result structs allocation and manage refcount for each elements to get rid of potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16allocate structs with wrappernobu
* parse.y (rb_parser_new, ripper_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. * variable.c (rb_autoload): ditto. * ext/digest/digest.c (rb_digest_base_alloc): ditto. * ext/strscan/strscan.c (strscan_s_allocate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16gc.c: rename alloc as wrapnobu
* gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename alloc as wrap. these functions do not allocate data pointers but just wrap the given pointers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14* ext/pathname/lib/pathname.rb: Remove condition of RUBY_VERSION <= 1.9.hsbt
[Feature #11082] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10* ext/zlib/zlib.c (rb_gzreader_external_encoding):glass
define GzipReader#external_encoding. [Bug #10900] * test/zlib/test_zlib.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e