aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (rb_newobj): force garbage_collect() if GC.stress == true.ko12010-11-041-17/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): do not need argument obj.ko12010-11-041-9/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): do not need argument obj.ko12010-11-041-6/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (before_gc_sweep): fix commit miss.ko12010-11-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (after_gc_sweep, before_gc_sweep):ko12010-11-041-5/+5
| | | | | | | | invoke rb_sweep_method_entry() as soon as possilbe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (after_gc_sweep, slot_sweep): finalizers should be invokedko12010-11-041-8/+5
| | | | | | | | as soon as possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.ko12010-11-031-55/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (finalizer_table, objspace->final.table):ko12010-10-311-42/+33
| | | | | | | | | | | Create finalizer_table at Init_heap(). Remove all null checks of finalizer_table. * gc.c (mark_tbl): skip if no table entries. * gc.c (slot_swee): remove useless need_call_final check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_free): finalizers should be called separatelynobu2010-10-311-1/+0
| | | | | | from freeing objspace. [ruby-dev:42479] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (before_gc_sweep, run_final): fix decrement timing of final_num.ko12010-10-281-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GC.stat): added. [ruby-dev:38607]ko12010-10-271-1/+51
| | | | | | | | * test/ruby/test_gc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, constant.h, gc.c, method.h, object.c, variable.c,mame2010-10-261-2/+35
| | | | | | | | | | | | vm_insnhelper.c: use struct rb_constant_entry_t as entry of RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant directly. Now instead rb_const_entry_t is contained in RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and have not only the value itself but also visibility flag. This is another preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, gc.c, object.c, variable.c, vm_insnhelper.c,mame2010-10-261-0/+4
| | | | | | | | | | include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL. RCLASS_IV_TBL has contained not only instance variable table but also constant table. Now the two table are separated to RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-2/+2
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_lazy_sweep): Variable declarations should be atko12010-10-211-1/+1
| | | | | | | | the head of block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (objspace_each_objects, rb_objspace_each_objects): usenobu2010-10-211-9/+14
| | | | | | | | struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (objspace_each_objects): fix return with no value.nobu2010-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_each_objects): don't lazy sweep innari2010-10-211-30/+70
| | | | | | rb_objspace_each_objects. [Bug #3940] [ruby-dev:42369] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),nobu2010-10-131-1/+2
| | | | | | | gc.c (undefine_final), time.c (time_mload): get rid of type-punning casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu2010-10-121-5/+11
| | | | | | | | | | | | | | (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free, rb_objspace_call_finalizer): fix truncatingnobu2010-10-121-2/+2
| | | | | | cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (mark_current_machine_context): suppress warnings.nobu2010-10-121-5/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): Index begins with 1.nari2010-08-161-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): use size_t. based on patches fromnari2010-08-161-16/+16
| | | | | | | Tomoaki NISHIYAMA <tomoakin@kenroku.kanazawa-u.ac.jp> at [ruby-dev:42042]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_gc_mark_threads): deprecated.nobu2010-08-141-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/objspace/test_objspace.rb: added test for objspace.nari2010-08-141-1/+1
| | | | | | | | * ext/objspace/objspace.c: considers T_ZOMBIE by lazy sweep GC. * gc.c: considers that dsize was 0. [ruby-dev:42022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: don't call after_gc_sweep() after when garbage_collect()nari2010-07-201-8/+9
| | | | | | | | | was called, because rb_sweep_method_entry() free live unlinked method entries. [ruby-core:31169] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-5/+6
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_each_objects): adjust indent.nobu2010-07-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (unlink_heap_slot, slot_sweep): unlink heaps_slot ofnari2010-06-291-11/+26
| | | | | | | | heaps_slot linked list if heaps_slot is empty at slot_sweep. fixed [ruby-dev:41543], [ruby-core:24894]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_lazy_sweep): clean a warning.naruse2010-06-181-1/+2
| | | | | | | | | | | | | | "suggest parentheses around assignment used as truth value" * transcode_data.h (getGB4bt1): clean a warning. "suggest parentheses around arithmetic in operand of |" * transcode_data.h (getGB4bt3): ditto. * vm.c (thread_free): clean a warning. "format 'p' expects type 'void *', but argument 3 has type 'struct rb_mutex_struct *'" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_obj_id): trivial optimization.nobu2010-06-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: set_heaps_increment is notnari2010-06-061-16/+21
| | | | | | | | | | called before gc_makrs of lazy sweeping because live_num not contain finalize objects. So call set_heaps_increment after lazy sweeping if free_num are not enough. And move free_min to struct rb_objspace for above. [ruby-dev:41499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_sweep): suppress a warning on VC, again.usa2010-06-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_all_clear): don't call obj_free() innari2010-05-301-15/+4
| | | | | | | | | | | | | | gc_mark_all_clear(), because obj_free() may make T_ZOMBIE objects. * gc.c (gc_clear_mark_on_sweep_slots): renamed. * gc.c (rb_objspace_call_finalizer): call gc_clear_mark_on_sweep_slots() before calling mark_tbl(). [ruby-dev:41459] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (RB_GC_SAVE_MACHINE_CONTEXT), gc.c (ruby_gc_stress_start):tarui2010-05-291-8/+0
| | | | | | | revert r28078. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC tarui2010-05-291-0/+8
| | | | | | | | | by switching the thread if gc_stress == true * gc.c (ruby_gc_stress_start): dotto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (force_chain_object, rb_objspace_call_finalizer): deletemame2010-05-291-1/+2
| | | | | | | finalizer entry after corresponding finalizer is executed. This caused SEGV when test/cgi is executed with GC.stress = true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GC_PROF_TIMER_STOP): regularize `marked' to suppressnobu2010-05-291-2/+2
| | | | | | | warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (allocate_sorted_heaps, before_gc_sweep, gc_sweep): removednobu2010-05-281-5/+1
| | | | | | unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c : use simple lazy sweep algorithm for response performancenari2010-05-281-165/+358
| | | | | | | | | | | | | | gain. See [ruby-dev:41067]. * object.c: FL_MARK of some objects by lazy sweep is copied when RVALUE is cloned. These objects are not marked in the mark phase. So delete FL_MARK. * class.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_sweep): suppres a warning on VC.usa2010-05-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings.nobu2010-05-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_unlink_method_entry, rb_sweep_method_entry):ko12010-05-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | added. Unlinked method entries are collected to vm->unlinked_method_entry_list. On the GC timing, mark all method entries which are on all living threads. Only non-marked method entries are collected. This hack prevents releasing living method entry. [Performance Consideration] Since this Method Entry GC (MEGC) doesn't occuer frequently, MEGC will not be a performance bottleneck. However, to traverse living method entries, every control frame push needs to clear cfp->me field. This will be a performance issue (because pushing control frame is occurred frequently). Bug #2777 [ruby-dev:40457] * cont.c (fiber_init): init cfp->me. * gc.c (garbage_collect): kick rb_sweep_method_entry(). * method.h (rb_method_entry_t): add a mark field. * vm.c (invoke_block_from_c): set passed me. * vm.c (rb_thread_mark): mark cfp->me. * vm_core.h (rb_thread_t): add a field passed_me. * vm_core.h (rb_vm_t): add a field unlinked_method_entry_list. * vm_insnhelper.c (vm_push_frame): clear cfp->me at all times. * vm_insnhelper.c (vm_call_bmethod): pass me. * bootstraptest/test_method.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_mark_method_entry): renamed.nobu2010-05-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GET_STACK_BOUNDS): fixed macro argument names. a patch fromnobu2010-04-141-1/+1
| | | | | | | | | | | | Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:40973]. * gc.h (ruby_get_stack_grow_direction): fixed prototype. * thread_pthread.c (get_stack, ruby_stack_overflowed_p): both side should be same type. [Bug #3145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e