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

33351 Коммитов

Автор SHA1 Сообщение Дата
nobu 33945edf39 Makefile.sub: C99 mathematics functions
* win32/Makefile.sub (config.h): fix version number of runtime
  library.  log2 needs to be defined, not only HAVE_LOG2.
  [ruby-core:57992] [Bug #9044]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 16:34:17 +00:00
nobu c7f60a0b23 * ChangeLog: adjust indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 16:34:14 +00:00
marcandre f9a169fff2 * lib/ostruct.rb: raise NoMethodError with a #name and #args.
Patch by Kenichi Kamiya. [Fixes GH-383]

* test/ostruct/test_ostruct.rb: Added tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:14:17 +00:00
marcandre 5b5de3984e * lib/ostruct.rb (Struct#each_pair): Return an enumerator with size
Patch by Kenichi Kamiya. [Fixes GH-383]

* test/ostruct/test_ostruct.rb: Added tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:13:57 +00:00
marcandre 99d5d90f2f * lib/ostruct.rb (OpenStruct#delete): Use the converted argument.
Patch by Kenichi Kamiya. [Fixes GH-383]

* test/ostruct/test_ostruct.rb: Added tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:13:38 +00:00
marcandre b9e18abe4a * lib/ostruct.rb: Raise RuntimeError when modifying frozen instances
instead of TypeError. Patch by Kenichi Kamiya. [Fixes GH-383]

* test/ostruct/test_ostruct.rb: Added tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:13:19 +00:00
marcandre dc215dcd9f * array.c: Add Array#to_h [Feature #7292]
* enum.c: Add Enumerable#to_h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:10:48 +00:00
svn 57e52dea77 * 2013-10-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:05:31 +00:00
tmm1 dd117ea118 * gc.c: Rename free_min to min_free_slots and free_min_page to max_free_slots. The algorithm for heap growth is:
if (swept_slots < min_free_slots) pages++
    if (swept_slots > max_free_slots) pages--

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 15:05:22 +00:00
nobu dd2979b3dd Makefile.sub: C99 mathematics functions
* win32/Makefile.sub (config.h): VC 2013 supports C99 mathematics
  functions.  [ruby-core:57981] [Bug #9044]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 13:51:05 +00:00
ko1 602241142f * gc.c: move increment from heap to heap_pages.
Share `increment' information with heaps.
* gc.c: change ratio of heap_pages_free_min_page
  to 0.80.
  This change means slow down page freeing speed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 10:16:01 +00:00
ko1 99c4e43d6a * gc.c (heap_pages_free_unused_pages): cast to (int) for size_t
variable `i'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 08:52:38 +00:00
ko1 69d787ff6d * gc.c: introduce tomb heap.
Tomb heap is where zombie objects and ghost (freed slot) lived in.
  Separate from other heaps (now there is only eden heap) at sweeping
  helps freeing pages more efficiently.
  Before this patch, even if there is an empty page at former phase
  of sweeping, we can't free it.
  Algorithm:
    (1) Sweeping all pages in a heap and move empty pages from the
        heap to tomb_heap.
    (2) Check all exsisting pages and free a page
        if all slots of this page are empty and
           there is enough empty slots (checking by swept_num)
  To introduce this pach, there are several tuning of GC parameters.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 08:48:54 +00:00
ko1 29ffa2c273 * gc.c (gc_prof_sweep_timer_stop): catch up recent changes
to compile on GC_PROFILE_MORE_DETAIL=1.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 05:22:10 +00:00
zzak 2bd5ab359d * file.c: [DOC] fix rdoc format of File#expand_path from r43386
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23 02:44:06 +00:00
svn 9229a0f3ce * 2013-10-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 15:46:26 +00:00
kazu a7e66877aa fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 15:46:21 +00:00
shyouhei ec6f077809 * vm_core.h (enum): avoid syntax error.
* method.h: ditto.

	* internal.h: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 12:59:27 +00:00
ko1 3d85d6edb5 * gc.c (Init_heap): move logics from heap_pages_init() and remove
heap_pages_init().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 10:54:44 +00:00
ko1 d6fe84b6f3 * gc.c: allow multiple heaps.
Now, objects are managed by page. And a set of pages is called heap.
  This commit supports multiple heaps in the object space.
  * Functions heap_* and rb_heap_t manages heap data structure.
  * Functions heap_page_* and struct heap_page manage page data
    strcuture.
  * Functions heap_pagse_* and struct rb_objspace_t::heap_pages
    maintains all pages.
    For example, pagaes are allocated from the heap_pages.
  See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/GC_design
  and https://bugs.ruby-lang.org/attachments/4015/data-heap_structure_with_multiple_heaps.png
  for more deitals.
  Now, there is only one heap called `eden', which is a space for all
  new generated objects.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 10:28:31 +00:00
akr 4292fd7798 * lib/pp.rb (object_address_group): Use Kernel#to_s to obtain the class
name and object address.
  This fix a problem caused by %p in C generates variable length
  address.
  Reported by ko1 via IRC.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 09:29:53 +00:00
eregon 5b91ab1f2e * file.c (File#expand_path): [DOC] improve documentation of File#expand_path.
Based on patch by Prathamesh Sonpatki. [ruby-core:57734] [Bug #9002]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 07:59:23 +00:00
nobu f57c988e34 dir.c: DOTMATCH to current directory
* dir.c (glob_helper): don't skip current directories if FNM_DOTMATCH
  is given.  [ruby-core:53108] [Bug #8006]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 06:59:54 +00:00
nobu 4ae79ade41 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 06:58:05 +00:00
ko1 f5b15f0e3f * vm_trace.c: exterminate Zombies.
There is a bug that T_ZOMBIE objects are not collected.
  Because there is a pass to miss finalizer postponed job
  with multi-threading. This patch solve this issue.
* vm_trace.c (rb_postponed_job_register_one): set
  RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job
  is registered.
  There is a possibility to remain a postponed job without
  interrupt flag.
* vm_trace.c (rb_postponed_job_register_one): check interrupt
  carefully.
* vm_trace.c (rb_postponed_job_register_one): use additional space
  to avoid buffer full.
* gc.c (gc_finalize_deferred_register): check failure.
* thread.c (rb_threadptr_execute_interrupts): check
  `postponed_job_interrupt' immediately.  There is a possibility
  to miss this flag.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 06:24:54 +00:00
nobu 3636f8c0f5 configure.in: check CFLAGS and LDFLAGS
* configure.in: check if the given CFLAGS and LDFLAGS are working, and
  bail out early if not.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 03:11:20 +00:00
nobu 2addc8cd5c internal.h: fix typo
* internal.h (rb_syserr_fail_path): fix typo on platforms where
  function name string predefined identifier is not supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 02:03:49 +00:00
nobu 22a961383a dir.c: warn Dir.exists?
* dir.c (rb_dir_exists_p): warn deprecated name.  [Bug #9041]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 17:06:31 +00:00
nobu 1ca90beaac * file.c (rb_file_exists_p): maybe FileTest.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 15:34:55 +00:00
svn 68b85e9d92 * 2013-10-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 15:07:03 +00:00
nobu 058d55ad2c file.c: warn File.exists?
* file.c (rb_file_exists_p): warn deprecated name.  [Bug #9041]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 15:06:59 +00:00
nobu 274e50c189 encoding.c: preserve outer errinfo
* encoding.c (load_encoding): should preserve outer errinfo, so that
  expected exception may not be lost.  [ruby-core:57949] [Bug #9038]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 14:57:55 +00:00
svn 3f939a449d * 2013-10-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 14:53:35 +00:00
nobu ac6268dbf0 assertions.rb: fix omitted message
* lib/test/unit/assertions.rb (assert_raise_with_message): remove
  omitted message by splatting nil.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-21 14:53:31 +00:00
nobu de004e3a5c io.c: make IO#reopen("pathname") atomic
* io.c (rb_io_reopen): create a new, temporary FD via rb_sysopen and
  call rb_cloexec_dup2 on it to atomically replace the file fptr->fd
  points to.  This leaves no possible window where fptr->fd is invalid
  to userspace (even for any threads running w/o GVL).  based on the
  patch by Eric Wong <normalperson@yhbt.net> at [ruby-core:57943].
  [Bug #9036]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 06:41:24 +00:00
nobu c6b9f2913a internal.h: rb_syserr_fail_path
* error.c (rb_syserr_fail_path_in): new function split from
  rb_sys_fail_path_in to raise SystemCallError without errno.
* internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without
  errno.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 06:29:06 +00:00
nobu 52231de913 internal.h: remove stale declaration
* internal.h (rb_w32_init_file): no longer defined since r43362.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 06:12:16 +00:00
nobu 291aead0b7 ruby.h: suppress warnings
* include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written),
  (rb_obj_write): suppress unused-parameter warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 04:58:49 +00:00
drbrain 3f15d35f83 * lib/rubygems: Update RubyGems to master 0886307. This commit
improves documentation and should bring ruby above 75% documented on
  rubyci.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 01:33:19 +00:00
drbrain 8552f7aa68 * lib/rubygems: Update to RubyGems master 3de7e0f. Changes:
Only attempt to build extensions for newly-installed gems.  This
  prevents compilation attempts at gem activation time for gems that
  already have extensions built.

  Fix crash in the dependency resolver for dependencies that cannot be
  resolved.

* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 00:31:12 +00:00
nobu 347e748bdd variable.c: real class name
* variable.c (rb_class2name): should return real class name, not
  singleton class or iclass.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 20:24:30 +00:00
svn ddbee25a3b * 2013-10-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 19:21:09 +00:00
tmm1 3a90444c55 * variable.c (rb_class2name): call rb_tmp_class_path() directly to avoid extra rb_str_dup() from rb_class_name().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 19:21:05 +00:00
nobu 16b445008d encdb.h.tmpl: remove stale macros
* template/encdb.h.tmpl: remove stale ENCIDX macros which never been
  used, ENCINDEX enums is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 12:00:41 +00:00
nobu cb4b55d3d8 win32/file.c: code page table
* win32/file.c (code_page): use simple array instead of st_table.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 10:59:06 +00:00
nobu eeb3156eca encoding.c: defer code page table
* encoding.c (rb_locale_encindex): defer initialization of win32 code
  page table until encoding db loaded.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 10:55:39 +00:00
nobu 6bf78ee633 gc.c: fix arity
* gc.c (Init_GC): fix arity of key? method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-18 23:50:13 +00:00
ko1 14c08fdb88 * gc.c: fix rb_objspace_t.
* make "struct heap" and move most of variables
    in rb_objspace_t::heap.
  * rename rb_objspace_t::heap::sorted to
     rb_objspace_t::heap_sorted_pages
     and make a macro heap_sorted_pages.
  * rename rb_objspace_t::heap::range to
     rb_objspace_t::heap_range and rename macros
     lomem/himem to heap_lomem/heap_himem.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-18 23:33:55 +00:00
drbrain 18b7112ec1 * lib/rubygems: Update to RubyGems master 42543b6. Changes:
Fix `gem update` for gems with multiple platforms.

* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-18 22:14:56 +00:00
svn aa7a74e4ff * 2013-10-19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-18 21:56:24 +00:00