aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (gc_page_sweep): refactoring.ko12014-06-051-19/+27
| | | | | | | | | * 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
* * gc.c (obj_free): check also FL_PROMOTED bit by RVALUE_OLD_P().ko12014-06-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: introduce RZombie to manage zombie objects.ko12014-06-041-65/+100
| | | | | | | | | | 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
* * gc.c (rb_objspace_free): should not rest_sweep() here.ko12014-06-031-2/+0
| | | | | | | | Some data structures are already freed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r46332 because RVALUE_OLD_P() returns int by r46334ko12014-06-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_call_finalizer_at_exit): addko12014-06-031-0/+3
| | | | | | | | 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
* * gc.c: change the counting method for young objects.ko12014-06-031-11/+17
| | | | | | | | | | | | | 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
* * gc.c: add verifying counters code in gc_verify_internal_consistency().ko12014-06-031-2/+50
| | | | | | | | | | | | | | 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
* gc.c: int for simple predicatesnobu2014-06-031-5/+5
| | | | | | * 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
* * gc.c (rb_gc_force_recycle): we only need to know the result (0/1)ko12014-06-031-1/+1
| | | | | | | | | 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
* * gc.c (objspace_live_slot): live slot count should not include finalko12014-06-031-1/+1
| | | | | | | | slot (contains T_ZOMBIE) count. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free): fix spacing.ko12014-06-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (check_gen_consistency): fix error message.ko12014-06-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: count old/young objects more correctly.ko12014-06-031-12/+34
| | | | | | | | | | | | | | * 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
* remove empty rb_gc_mark_parser functionnormal2014-05-291-3/+0
| | | | | | | | * 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
* gc.c: fix typonobu2014-05-241-1/+1
| | | | | | | * 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
* gc.c (rb_free_m_tbl): mark function as staticnormal2014-05-221-1/+1
| | | | | | | * 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
* fix typenaruse2014-05-181-2/+2
| | | | | | | 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
* * gc.c (gc_marks, gc_marks_body): increase the counter of young objectsko12014-05-161-3/+6
| | | | | | | | | 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
* * gc.c (gc_before_sweep): heap_pages_swept_slots should containsko12014-05-161-1/+2
| | | | | | | | | | 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
* * gc.c (heap_extend_pages): fix indent.nobu2014-05-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect_body): move gc_heap_prepare_minimum_pages()ko12014-05-151-2/+2
| | | | | | | | from gc_sweep(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (heap_extend_pages): calculate next growing heap size.ko12014-05-151-11/+15
| | | | | | | | | | | | * 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
* * gc.c: introduce macros to remove magic number.ko12014-05-151-2/+9
| | | | | | | | | | | 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
* * gc.c: enable RGENGC_AGE2_PROMOTION.ko12014-05-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rgengc_rememberset_mark): promote remembered object earlier.ko12014-05-141-7/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: count young object correctly and show it in GC.statko12014-05-121-4/+18
| | | | | | | | | | | | | | 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
* gc.c: fix argument types for st_foreachnobu2014-05-071-5/+9
| | | | | | | | | * 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
* * gc.c (gc_after_sweep): suppress unnecessary expanding heap.nari2014-04-301-1/+0
| | | | | | | 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
* * gc.c: This argument must be a pointer.nari2014-04-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Fix typos. These are undefined variables.nari2014-04-281-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (objspace_malloc_increase): don't cause GC by malloc_increaseko12014-04-211-13/+13
| | | | | | | | | | | 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
* gc.c: full mark after malloc/reallocnobu2014-04-211-2/+8
| | | | | | | * 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
* gc.c: GC.stress after reallocnobu2014-04-211-1/+1
| | | | | | | * 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
* gc.c: fixnum GC stressnobu2014-04-211-3/+13
| | | | | | | | | * 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
* gc.c: drop special case for big hash/arraynormal2014-04-191-14/+3
| | | | | | | * 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
* gc.c: suppress a warningnobu2014-04-171-1/+1
| | | | | | * 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
* gc.c: no newline to rb_bugnobu2014-04-111-7/+7
| | | | | | | * 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
* * gc.c (gc_verify_internal_consistency): move lines and enableko12014-04-101-79/+89
| | | | | | | | allrefs_dump() on RGENGC_CHECK_MODE >= 4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debugko12014-04-101-1/+1
| | | | | | | | message when RGENGC_CHECK_MODE == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: check rgengc_report argumentnobu2014-04-101-3/+8
| | | | | | | | | | * 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
* gc.c: do nothing unless USE_RGENGCnobu2014-04-101-2/+2
| | | | | | | * 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
* gc.c: adjust indentnobu2014-04-101-2/+2
| | | | | | | * 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
* Add comment.akr2014-04-091-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (mark_current_machine_context): Call SET_STACK_END.akr2014-04-091-0/+1
| | | | | | | | 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
* * gc.c: rename `RGENGC_THREEGEN' to `RGENGC_AGE2_PROMOTION'.ko12014-04-081-42/+58
| | | | | | | | | | | * gc.c (rgengc_rememberset_mark): don't promote, but remain in remember set for infant objects. * gc.c (RVALUE_PROMOTE_INFANT, RVALUE_PROMOTE_YOUNG): count numbers in these functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, gc.h (rb_objspace_each_objects_without_setup):ko12014-04-021-0/+10
| | | | | | | | | | Add a new (hidden) C-API to iterate objspace snapshot. This API is not safe to call any C-APIs in a given callback function. Be careful to use this C-API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: avoid inadvertent pin-downnobu2014-03-301-4/+6
| | | | | | | | * gc.c (gc_info_decode): get rid of inadvertent dynamic symbol pin-down, and preserve encoding in error messages. also should not use RSTRING_PTR macro on function calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_before_sweep): cap `malloc_limit' toko12014-03-291-1/+1
| | | | | | | | | | | | gc_params.malloc_limit_max. It can grow and grow with such case: `loop{"a" * (1024 ** 2)}' [Bug #9687] This issue is pointed by Tim Robertson. http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: support Symbol GC. [ruby-trunk Feature #9634]nari2014-03-261-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See this ticket about Symbol GC. * include/ruby/ruby.h: Declare few functions. * rb_sym2id: almost same as old SYM2ID but support dynamic symbols. * rb_id2sym: almost same as old ID2SYM but support dynamic symbols. * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not pin down a dynamic symbol. Declare a new struct. * struct RSymbol: represents a dynamic symbol as object in Ruby's heaps. Add few macros. * STATIC_SYM_P: check a static symbol. * DYNAMIC_SYM_P: check a dynamic symbol. * RSYMBOL: cast to RSymbol * gc.c: declare RSymbol. support T_SYMBOL. * internal.h: Declare few functions. * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this function at a sweep phase. * rb_str_dynamic_intern: convert a string to a dynamic symbol. * rb_check_id_without_pindown: not pinning function. * rb_sym2id_without_pindown: ditto. * rb_check_id_cstr_without_pindown: ditto. * string.c (Init_String): String#intern and String#to_sym use rb_str_dynamic_intern. * template/id.h.tmpl: use LSB of ID as a flag for determining a static symbol, so we shift left other ruby_id_types. * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to avoid pinning. * load.c: use xx_without_pindown function at creating temporary ID to avoid pinning. * object.c: ditto. * sprintf.c: ditto. * struct.c: ditto. * thread.c: ditto. * variable.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e