* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
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
* 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
* 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
* 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
* 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
* 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
* 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