array.c: fix potential memory leak

* array.c (ary_new): allocate buffer in heap after new object get
  allocated successfully, to get rid of potential memory leak at
  object allocation failure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
st: test packed-to-unpacked transitions during iteration

The st_foreach and st_foreach_check functions support transitioning
from a packed to an unpacked state during iteration.  However, this
functionality did not get exercised by the current test suite until
now.  This should help us prevent breakage when making modifications
to st.

* ext/-test-/st/foreach/extconf.rb: new file
* ext/-test-/st/foreach/foreach.c: ditto
* test/-ext-/st/test_foreach.rb: ditto
  [Feature #10321]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* properties.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
internal.h: optimize rb_ary_new_from_args

* internal.h (rb_ary_new_from_args): optimization by expanding
  arguments in caller to get rid of va_list if possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tcltklib.c: typed data

* ext/tk/tcltklib.c (tcltkip_type): use typed data.

* ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): hide
  internal objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c (absint_numwords_generic): set an array element after
  definition of a variable to fix compile error with older version
  of fcc (Fujitsu C Compiler) 5.6 on Solaris 10 on Sparc.
  [Bug #10350] [ruby-dev:48608]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ruby/io.h: deprecate old macros

* include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
  deprecate old macros for compatibility for ruby 1.8 and older.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 2014-10-10

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
io.c: move RFile initialization

* io.c (rb_io_make_open_file): move from include/ruby/io.h, and
  hide too detailed implementations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Update doc. and warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
io.c: fix typo

* io.c (rb_io_make_open_file): remove useless backslash.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ruby/ruby.h: eliminate disabled function call

* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): eliminate function
  call for warning/error if not match to get rid of unconditional
  warning/error by a certain compiler option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ruby/ruby.h: fix for older gcc

* configure.in (__builtin_choose_expr_constant_p): in gcc 4.8 or
  earlier, __builtin_choose_expr() does not consider
  __builtin_constant_p(variable) a constant expression.

* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix for older gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
thread.c: fix for older gcc

* thread.c (only_if_constant): get rid of __builtin_choose_expr()
  on older gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
open-uri: accept :open_timeout option

* lib/open-uri.rb (OpenURI::Options): add :open_timeout default
* (def OpenURI.open_http): check :open_timeout option
* (module OpenURI): rdoc for :open_timeout
* test/open-uri/test_open-uri.rb (test_open_timeout): new test
  [Feature #10361]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 2014-10-11

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/unixsocket.c: [DOC] Fix example to render in HTML
  properly, with a patch by @eval [Fixes GH-733]
  https://github.com/ruby/ruby/pull/733


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Merges a patch form naclports.

* configure.in (RUBY_NACL and others): Supports PNaCl.
* dln.c: replace the old hacky dynamic loading over HTTP with nacl_io.
* file.c: tenatively use access(2) instead of eaccess.
  (rb_file_load_ok): weaken with attribute but not by postprocess.
* io.c (socket.h): now NaCl has socket.h
  (flock): disable here instead of nacl/ioctl.h
* nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY):
  respect path to them if they are absolute.
  This helps naclports to build ruby in their source tree.
  (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl.
  (ruby.o, file.o): move the hack to attributes in ruby.c and file.c
* nacl/ioctl.h: removed. move the hack to io.c.
* nacl/nacl-config.rb: support arm, pnacl and others.
* nacl/pepper_main.c: support build in a naclports tree.
* ruby.c (rb_load_file): weaken with attribute but not by postprocess.

The patch is by sbc@google.com and the Native Client Authors.
It is available at:
* https://chromium.googlesource.com/external/naclports.git/+/873ca4910a5f9d4206306aacb4ed79c587c6a5f3/ports/ruby/nacl.patch

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Allow failure of sighandler installation on NativeClient.

* signal.c (install_signalhandler, init_sigchld): allow failure because it
  always fails with ENOSYS on NaCl.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: fix issues in the last two commits. don't disable cloexec for
  platforms other than NativeClient.
* ChangeLog: ditto. add entries for the last two commits.
Sat Oct 11 11:12:00 2014  Yuki Yugui Sonoda  <yugui@yugui.jp>

	* signal.c (install_signalhandler, init_sigchld): allow failure because it
	  always fails with ENOSYS on NaCl.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e