summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2014-06-18constify parametersnobu
* include/ruby/intern.h: constify `argv` parameters. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-17* gc.c (obj_memsize_of): memsize_of(T_ZOMBIE) returns 0, not a rb_bug.ko1
ObjectSpace.count_objects_size() uses memsize_of(T_ZOMBIE). This bug introduced at r46348. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-10* gc.c: invoke GC before memory allocation (xmalloc/xrealloc)ko1
when GC.stress = true. [Bug #9859] * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-09* gc.c: change full GC timing to keep lower memory usage.ko1
Extend heap only at (1) after major GC or (2) after several (two times, at current) minor GC Details in https://bugs.ruby-lang.org/issues/9607#note-9 [Bug #9607] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-09gc.c: fix typonobu
* gc.c (gcdebug_sentinel): fix typo, "sentinel" not "sential". [fix GH-634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05* gc.c (gc_page_sweep): refactoring.ko1
* gc.c (gc_page_sweep): should not set, but add final_slots into sweep_page->final_slots. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05* gc.c (obj_free): check also FL_PROMOTED bit by RVALUE_OLD_P().ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-04* gc.c: introduce RZombie to manage zombie objects.ko1
Rewrite finalizing logics with this type. * gc.c (gc_verify_internal_consistency): verify zombie (finalizing) objects count. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (rb_objspace_free): should not rest_sweep() here.ko1
Some data structures are already freed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03revert r46332 because RVALUE_OLD_P() returns int by r46334ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (rb_gc_call_finalizer_at_exit): addko1
gc_verify_internal_consistency() when RGENGC_CHECK_MODE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c: change the counting method for young objects.ko1
clear counter at the beggining of every GC and count promoted (infant->young) objects. Some promotions (infant->young) are transition of promoting to old objects. We should not count such promotions. With this technique, we don't need to check young objects at obj_free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c: add verifying counters code in gc_verify_internal_consistency().ko1
gc_verify_internal_consistency() counts all - live objects - young objects (if age2 promotion) - old objects in all pages and compares with objspace managing counters. * gc.c (gc_after_sweep): do gc_verify_internal_consistency() when RGENGC_CHECK_MODE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03gc.c: int for simple predicatesnobu
* gc.c: use int for simple predicate functions instead of VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (rb_gc_force_recycle): we only need to know the result (0/1)ko1
of RVALUE_OLD_P(). clang fails to compile it because is_old is `int' but RVALUE_OLD_P() returns VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (objspace_live_slot): live slot count should not include finalko1
slot (contains T_ZOMBIE) count. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (obj_free): fix spacing.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c (check_gen_consistency): fix error message.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03* gc.c: count old/young objects more correctly.ko1
* gc.c (RVALUE_DEMOTE_FROM_OLD): decrement old object count. * gc.c (RVALUE_DEMOTE_FROM_YOUNG): decrement young object count. * gc.c (rb_gc_resurrect): increment old object count. * gc.c (gc_marks_body): should not add old object count. This code is completely my misunderstanding. * gc.c (rb_gc_force_recycle): decrement young or old object count correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29remove empty rb_gc_mark_parser functionnormal
* parse.y (rb_gc_mark_parser): remove, empty since r8758 * internal.h: ditto, not usable from extensions since 2.0.0 * gc.c (gc_mark_roots): remove checkpoint for parser git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-24gc.c: fix typonobu
* gc.c (objspace_malloc_increase): fix typo. "increase" not "incraese". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-22gc.c (rb_free_m_tbl): mark function as staticnormal
* gc.c (rb_free_m_tbl): mark function as static * method.h (rb_free_m_tbl): remove prototype git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18fix typenaruse
struct RVALUE.file is const char*. struct RVALUE.line is int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-16* gc.c (gc_marks, gc_marks_body): increase the counter of young objectsko1
at the major GC because AGE2Promotion changes all old objects into young objects at major GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-16* gc.c (gc_before_sweep): heap_pages_swept_slots should containsko1
heap_pages_increment. For example, GC by exceeding malloc_limit can remain heap_pages_increment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-15* gc.c (heap_extend_pages): fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-15* gc.c (garbage_collect_body): move gc_heap_prepare_minimum_pages()ko1
from gc_sweep(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-15* gc.c (heap_extend_pages): calculate next growing heap size.ko1
* gc.c (heap_set_increment): accept addition pages instead of minimum pages. * gc.c (gc_after_sweep): use heap_etend_pages(). * gc.c (gc_heap_prepare_minimum_pages): add only 1 page. * gc.c (heap_ready_to_gc): add only 1 page. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-15* gc.c: introduce macros to remove magic number.ko1
GC_HEAP_FREE_SLOTS_MIN_RATIO = 0.3: guarantee minimum empty slots ratio after sweep. GC_HEAP_FREE_SLOTS_MAX_RATIO = 0.8: allow to free pages 0.2 (= 1-0.8) of current existing slots. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-14* gc.c: enable RGENGC_AGE2_PROMOTION.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-14* gc.c (rgengc_rememberset_mark): promote remembered object earlier.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-12* gc.c: count young object correctly and show it in GC.statko1
on RGENGC_AGE2_PROMOTION. * gc.c (RVALUE_PROMOTE_YOUNG): decrement young object count on YOUNG->OLD. * gc.c (obj_free): decrement young object count when young object freed. * gc.c (gc_marks): should not clear young object count. * gc.c (gc_stat_internal): GC.stat :young_object information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-07gc.c: fix argument types for st_foreachnobu
* gc.c ({free,mark}_{method,const}_entry_i): fix argument types as st_data_t for st_foreach(). * gc.c (rgengc_unprotect_logging_exit_func_i): add third argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-30* gc.c (gc_after_sweep): suppress unnecessary expanding heap.nari
Tomb heap pages are freed pages here, so expanding heap is not required. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-28* gc.c: This argument must be a pointer.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-28* gc.c: Fix typos. These are undefined variables.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21* gc.c (objspace_malloc_increase): don't cause GC by malloc_increaseko1
when memop type is MEMOP_TYPE_REALLOC. GC at realloc is not well maintained. We need a time to make it safe. [ruby-dev:48117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: full mark after malloc/reallocnobu
* gc.c (objspace_malloc_increase): run full mark if 0x04 bit is set in ruby_gc_stress. [ruby-core:62103] [Feature #9761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: GC.stress after reallocnobu
* gc.c (objspace_malloc_increase): run GC after realloc not only malloc and calloc by GC.stress. [ruby-core:62103] [Feature #9761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: fixnum GC stressnobu
* gc.c (garbage_collect_body): name magic numbers. * gc.c (gc_stress_set): GC.stress accepts not only boolean but also Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-19gc.c: drop special case for big hash/arraynormal
* gc.c (rb_gc_writebarrier): drop special case for big hash/array [Bug #9518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-17gc.c: suppress a warningnobu
* gc.c (get_envparam_size): suppress a warning by char-subscripts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-11gc.c: no newline to rb_bugnobu
* gc.c: no newline in messages for rb_bug, it outputs a newline after the message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10* gc.c (gc_verify_internal_consistency): move lines and enableko1
allrefs_dump() on RGENGC_CHECK_MODE >= 4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10* gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debugko1
message when RGENGC_CHECK_MODE == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: check rgengc_report argumentnobu
* gc.c (rgengc_report): use __VA_ARGS__ if possible. * gc.c (rgengc_report_body): check argument. * gc.c (heap_page_allocate): fix missing argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: do nothing unless USE_RGENGCnobu
* gc.c (gc_verify_internal_consistency): always do nothing unless USE_RGENGC is set, no local variable needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: adjust indentnobu
* gc.c (RVALUE_DEMOTE_FROM_YOUNG, RVALUE_DEMOTE_FROM_OLD): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09Add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09* gc.c (mark_current_machine_context): Call SET_STACK_END.akr
This reverts a hunk of r40703 by ko1. This fixes [ruby-dev:48098] [Bug #9717]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e