process.c: tmp buffer instead of alloca

* process.c (OBJ2UID1, OBJ2GID1): separate from OBJ2UID and
  OBJ2GID respectively, need given buffers.

* process.c (OBJ2UID, OBJ2GID): no longer need PREPARE_GETPWNAM
  and PREPARE_GETGRNAM.

* process.c (obj2uid, obj2gid): use tmp buffer instead of alloca
  to get rid of potential stack overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
process.c: GETPW_R_SIZE_INIT, GETGR_R_SIZE_INIT

* process.c (GETPW_R_SIZE_INIT, GETGR_R_SIZE_INIT): sysconf values
  are not maximum sizes, but initial sizes.

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

* process.c (obj2uid, obj2gid): need capacity as buffer size, not
  length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
process.c: expand buffer on ERANGE

* process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
  may need larger buffers than sysconf values, so retry with
  expanding the buffer when ERANGE is returned.
  [ruby-core:61325] [Bug #9600]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ext/dl, ext/fiddle: fix memory leak

* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
  ext/fiddle/handle.c (fiddle_handle_free),
  ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
  based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].

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

* enum.c (each_val_i): svalue is no longer used.
  [ruby-core:61340] [Bug #9605]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
vm.c: cleanup to use rb_method_entry_at

* vm.c (add_opt_method): cleanup to use rb_method_entry_at
  Easier experiments with a non-st method entry tables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[DOC] Add NEWS about Find#find, Pathname#find.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
variable.c (struct global_variable): shrink by 8 bytes on 64-bit

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: remove needless space.
  [ruby-dev:48026] [Bug #9615]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/ruby/envutil.rb: compare RSS to check memory leak

* test/ruby/envutil.rb (Test::Test#assert_no_memory_leak): compare
  also RSS if available.

* test/ruby/memory_status.rb (Memory::Status.parse): read string
  form of an instance.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tests for [Bug #9599]

* test/dl/test_{cptr,handle}.rb: tests for [Bug #9599].

* test/fiddle/test_{handle,pointer}.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fiddle/function.c: check argument size

* ext/fiddle/function.c (initialize): check argument number if the
  temporary buffer exceeds size_t max.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fiddle/function.c: fix memory leak on exception

* ext/fiddle/function.c (function_call): fix memory leak when an
  exception occurs at argument conversion or the function call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
class.c: check for malloc failures

* class.c (rb_class_subclass_add): use xmalloc
* class.c (rb_module_add_to_subclasses_list): ditto
* class.c (rb_class_remove_from_super_subclasses): use xfree
* class.c (rb_class_remove_from_module_subclasses): ditto
  [Bug #9616]

xmalloc does OOM checking and helps GC accounting when used
with xfree.

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

* test/ruby/test_enumerator.rb (test_iterators): fix test for hash
  iterators.  [Fixes GH-558]

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: always check dladdr(1).

* addr2line.c (fill_lines): show the line number in C backtrace if
  ruby is built without --enable-shared (PIE) on Linux.
  patch is originally by Shinichiro Hamaji
  https://twitter.com/shinh/status/441957774264504321
  NOTE: ld doesn't insert __executable_start for PIE.
  dladdr(3)'s argument must be a function pointer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_dump.c (rb_vm_bugreport): show vm maps on FreeBSD.

* vm_dump.c (procstat_vm): copied from FreeBSD.
  http://svnweb.freebsd.org/base/head/usr.bin/procstat/procstat_vm.c?revision=261780

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