Граф коммитов

39475 Коммитов

Автор SHA1 Сообщение Дата
normal d8bbb5eda8 socket: avoid redundant fcntl on Linux
* 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-29 02:24:18 +00:00
normal 1dd4c763c0 ChangeLog: add missing reference [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29 02:16:50 +00:00
normal 16aeffefa2 lib/*: use monotonic clock for timeouts
The monotonic clock is preferred as it is guaranteed to be
continuous and not subject to jumps due to adjustments.

* lib/net/resolv.rb (request): use monotonic clock
* lib/net/http.rb (begin_transport, end_transport): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29 01:40:26 +00:00
svn c1b35ab11e * 2015-05-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28 19:40:26 +00:00
ko1 6abf7938bf * ext/objspace/objspace.c: add two methods to debug internals.
* 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-28 19:40:04 +00:00
nobu 4d059bf9f5 generator.c: allocate structs with wrapper
* 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-28 07:17:55 +00:00
nobu cbf902fc33 parser.rl: allocate structs with wrapper
* 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-28 07:17:42 +00:00
nobu 828de1a06d win32ole.c: wrapper object before alloc
* 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-28 06:46:17 +00:00
nobu fbc67dbf2c tcltklib.c: allocate structs with wrapper
* 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-28 06:45:55 +00:00
nobu d50260117f tkutil.c: check arguments type
* 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-28 06:44:43 +00:00
nobu 0c58f69791 tkutil.c: check type
* 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-28 05:53:05 +00:00
svn c8b3f1b470 * 2015-05-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 21:56:51 +00:00
nobu 86f7fceef4 Fix typo in samples for tk ext [skip ci]
* 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-27 21:56:04 +00:00
nobu c83883cf4e tcltklib.c: fix memory leak
* 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-27 13:36:27 +00:00
nobu 19341b86be test_bigdecimal.rb: adjust
* test/bigdecimal/test_bigdecimal.rb (assert_no_memory_leak): fix
  GC scope and adjust limits.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 10:56:33 +00:00
nobu bdf07741f3 bigdecimal.c: wrapper object before alloc
* 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-27 08:02:28 +00:00
nobu 2df5bb9ac1 envutil.rb: EnvUtil.gc_stress_to_class
* test/lib/envutil.rb (EnvUtil.gc_stress_to_class): check if
  GC.stress_to_class is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 08:02:20 +00:00
nobu b38b920ae5 gc.c: mark stress_to_class
* gc.c (gc_mark_roots): stress_to_class is also a GC root.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 05:55:00 +00:00
nobu 7615c70db7 gc.c: stress_to_class
* gc.c (newobj_of): debug feature to fail allocation of particular
  classes.

* gc.c (rb_gcdebug_add_stress_to_class): add classes to the list.

* gc.c (rb_gcdebug_remove_stress_to_class): remove classes from
  the list.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 02:08:29 +00:00
normal 9fbf488746 openssl: use RB_GC_GUARD instead of volatile
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-27 01:09:11 +00:00
normal 46ad38a44d drb: avoid redundant fcntl call
Sockets are close-on-exec by default since Ruby 2.0, so it
is redundant to set it again.

* lib/drb/drb.rb (set_sockopt): remove redundant fcntl call
* lib/drb/unix.rb (set_sockopt): ditto
  [ruby-core:69128] [Feature #11137]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 00:43:02 +00:00
svn a98f72f20c * 2015-05-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 00:38:42 +00:00
nobu bea4ccb2db ossl_asn1.c: [DOC] Fix typo [skip ci]
* 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-27 00:38:11 +00:00
shugo 834d2bbe4d * vm_method.c (rb_alias): should resolve refined methods.
[ruby-core:69360] [Bug #11182]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-26 13:16:18 +00:00
svn 37aec839d6 * 2015-05-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-26 12:38:03 +00:00
kazu d5a93ed109 fix condition
* include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): fix condition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-26 12:37:42 +00:00
usa 19f7dd85c4 * tool/redmine-backporter.rb (rel): after the relations is changed,
@changesets is no longer right.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-25 13:38:00 +00:00
naruse fdb62480cd add .gitignore rules for Microsoft Visual C++
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-25 05:48:48 +00:00
naruse d4bafbb45f * win32/win32.c (setup_overlapped): seek to the file end only when
writing (mode:a), not reading (mode:a+, read).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-25 02:35:31 +00:00
nobu 5c0fb216f7 io.c: refine message
* io.c (prepare_getline_args): refine the expected arity in an
  exception message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-25 02:33:36 +00:00
svn 42d06ac13b * 2015-05-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-24 15:33:23 +00:00
eregon 2e1835b69d * numeric.c (Numeric#negative?): [DOC] Fix call-seq.
Patch by @yui-knk. [Fixes GH-908]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-24 15:33:08 +00:00
nobu e28addcf5b ruby.c: show_usage_line
* ruby.c (show_usage_line): extract function to print one usage
  line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-24 02:20:10 +00:00
svn 3de8b4bed1 * 2015-05-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 16:37:04 +00:00
ko1 5ea16ea6de * debug.c (ruby_debug_print_id): use rb_id2name() for fprintf().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 16:36:26 +00:00
nobu 8b5ffc3683 win32.c: suppress a warning
* win32/win32.c (rb_w32_write_console): fix the type to suppress a
  warning of difference in signedness.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 11:07:18 +00:00
nobu 817507373d man: updated
* man/*.1: updated dates in man pages.
  [ruby-dev:48988] [Bug #11171]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:38:49 +00:00
nobu aaa123591d common.mk: update-man-date
* common.mk (update-man-date): update last date in man pages.

* tool/vcs.rb (VCS#modified): returns last modified time.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:36:33 +00:00
nobu 80000c534c file2lastrev.rb: format for modified
* tool/file2lastrev.rb: add optional argument to --modified, for
  strftime format.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:36:22 +00:00
nobu b8081c7c4c file2lastrev.rb: all ARGV
* tool/file2lastrev.rb: output for each arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:36:05 +00:00
nobu 8009794c09 rake.1: removed
* man/rake.1: rake has been gemified.  [Feature #11025]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 07:58:56 +00:00
usa 7ceb9ecc31 * win32/win32.c (rb_w32_write_console): should return the count of
actually eaten characters, include escape sequences.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 18:13:32 +00:00
usa 3f4aab1621 * win32/win32.c (constat_apply): fixed comment. [skip ci]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 17:37:15 +00:00
svn a1147b911f * 2015-05-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 15:26:25 +00:00
kazu 511a9f79aa fix indent (tabify) [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 15:26:23 +00:00
kazu 9bab9d5092 fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 15:26:11 +00:00
marcandre 2c686723fe * lib/matrix.rb: Styling
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 13:37:02 +00:00
marcandre d2487ed475 * lib/prime.rb: Remove obsolete Prime.new
patch by Ajay Kumar. [Fixes GH-891]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 13:36:39 +00:00
nobu 3a08b7e204 intern.h: move rb_sym_all_symbols
* include/ruby/intern.h (rb_sym_count): move `rb_sym_all_symbols`
  to a symbol.c specific section.  a part of patch by Lourens
  Naudé.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 12:13:14 +00:00
nobu c7b63ec872 test_parse.rb: move assertions
* test/ruby/test_module.rb (test_remove_class_variable): move an
  assertion for Module#remove_class_variable from test_parse.rb.

* test/ruby/test_symbol.rb (test_intern, test_all_symbols): move
  assertions for Symbol#intern and Symbol.all_symbols from
  test_parse.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 12:10:52 +00:00