We only need one sweep time measurement without lazy sweep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (GC_MALLOC_LIMIT): change default value to 16MB.
* gc.c (GC_MALLOC_LIMIT_GROWTH_FACTOR): change default value to 2.0.
* gc.c (gc_before_sweep): change decrease ratio of `malloc_limit'
from 1/4 to 1/10.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc_rest_sweep() can reduce malloc_increase, so try it before GC.
Otherwise, malloc_increase can be less than malloc_limit at
gc_before_sweep(). This means that re-calculation of malloc_limit
may be wrong value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
After rb_gc_force_recycle() for a object blonging to heap->freelist,
`heap->using_page->freelist' is not null.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* range.c (SET_EXCL): set boolean always.
* range.c (range_init): fix int flag and boolean VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_mod_const_get, rb_mod_const_set, rb_mod_const_defined
Also added note about NameError exception for invalid constant name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
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
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
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
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
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
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
* 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
* 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
* 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