summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
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
2015-05-10* ext/win32ole/win32ole_variant.c: fix typo "indicies".glass
the patch is from davydovanton <antondavydov.o at gmail.com>. [fix GH-892] * lib/rubygems/indexer.rb: ditto. * test/rubygems/test_gem_indexer.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08ext/socket/ancdata.c (bsock_recvmsg_internal): GC guardnormal
The control buffer may be used throughout the function, so prevent the string from being lost to GC. * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard [Bug #11123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08extconf.rb: no nmake style VPATHnobu
* ext/io/console/extconf.rb: only nmake needs remove style VPATH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08depend: no nmake style VPATHnobu
* ext/io/console/depend: remove nmake style VPATH, for normal makes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-07checksum.rb: check the targetnobu
* tool/checksum.rb (Checksum#update?): check if the target exists too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-07win32_vk.inc: renamednobu
* ext/io/console/win32_vk.inc: renamed not to be included in HDRS by mkmf.rb and regenerated unexpectedly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06io/console: win32_vk dependenciesnobu
* ext/io/console/depend: check if VK table is modified by the checksum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06stdlib: use IO#wait_*able instead of IO.select when possiblenormal
In case a process encounters high-numbered FDs, this allows consistent performance on systems with ppoll support. [ruby-core:35572] * ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable * lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable * lib/webrick/httpserver.rb (run): ditto * lib/resolv.rb (request): ditto for single socket case [ruby-core:68943] [Feature #11081] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-05io/console: vk_header only on Windowsnobu
* ext/io/console/extconf.rb: vk_header is used only on Windows, nonsense to update on other platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: pressed? on Windowsnobu
* ext/io/console/console.c (console_key_pressed_p): new method IO#pressed? on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: cursor position on Windowsnobu
* ext/io/console/console.c (console_goto): new method IO#goto on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_pos): new method IO#cursor on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_set): new method IO#cursor= on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: IO#beepnobu
* ext/io/console/console.c (console_beep): new method IO#beep. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03* ext/-test-/file/fs.c: need to include sys/statvfs.hodaira
to use statvfs(). * ext/-test-/file/extconf.rb: check the existence of sys/statvfs.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: remove old ifdefnobu
* ext/io/console/console.c (LAST_ERROR): remove old ifdef, should use rb_w32_map_errno always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30ipsocket.c: fix merge missnobu
* ext/socket/ipsocket.c (init_inetsock_internal): fix local variable name by merge miss. [ruby-core:68531] [Bug #10975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30ipsocket.c: sys_errornobu
* ext/socket/ipsocket.c (init_inetsock_internal): preserve errno before other library calls and use rb_syserr_fail. [ruby-core:68531] [Bug #10975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20socket: avoid common exceptions when calling connect_nonblocknormal
Errno::EISCONN and IO::WaitReadable exceptions are common, expensive, and noisy under normal use. Avoid raising on them since they are not exceptional. * ext/socket/lib/socket.rb (connect_internal): avoid common exceptions from connect_nonblock. [ruby-core:68909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20* ext/openssl/*: use license instead of licence.hsbt
[fix GH-876][ci skip] Patch by @davydovanton * lib/net/https.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20connect_nonblock(..., exception: false) does not raise EISCONNnormal
* ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN [ruby-core:68926] [Feature #11072] * test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect This is to reduce exceptions for code which issues a (IMHO, unnecessary) second connect() syscall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e