aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (gc_lazy_sweep): if sweep target slots are not found, wenari2011-08-091-0/+7
| | | | | | | | | | try heap_increment() because it might be able to expand the heap. [Bug #5127] [ruby-dev:44285] * gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was interrupted, we expand the heap if at all possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refix r32815.naruse2011-08-021-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (init_heap): allocate sigaltstack after heaps are allocated.naruse2011-08-021-0/+8
| | | | | | | | | | [ruby-dev:44315] [Bug #5139] * vm.c (thread_free): use free because objspace is not ready. * vm.c (th_init): use malloc because objspace is not ready. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (struct METHOD), gc.c (gc_marks), vm_method.cmame2011-07-251-0/+2
| | | | | | | | | | | (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug. rb_method_entry_t was free'd even when the method is still on the stack if it is BMETHOD (i.e., Method#call). This is because rb_method_entry_t is embedded in struct METHOD. This commit separates them and marks the live method entries. See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Improve documentationdrbrain2011-07-081-25/+52
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: change water_mark value value that may callnari2011-07-071-8/+9
| | | | | | | | | | | gc_mark(lev <= GC_LEVEL_MAX) in gc_mark(). In ruby_stack_check(), water_mark is a value that may call some C function. Fixes Bug #3781 * configure.in: define GC_MARK_STACKFRAME_WORD that approximate size of gc_mark() and gc_mark_children() stackframes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.kosaki2011-06-161-1/+1
| | | | | | | | | * gc.c (rb_newobj): ditto. * vm_insnhelper.c (vm_method_search): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: fix a regression by r31690 on AIX because AIX mallockosaki2011-06-151-5/+9
| | | | | | | | | | | | return NULL if it's passed 0. But some caller don't expect it. patch by Yutaka Kanemoto. (vm_malloc_prepare): return calculated size. (vm_xmalloc): use above result. (vm_xcalloc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): call initial_expand_heap ifnari2011-06-141-1/+1
| | | | | | initial_heap_min_slots is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: use size_t.nari2011-06-141-14/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.nobu2011-06-121-0/+9
| | | | | | * gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mignw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: expand heap if initial_heap_min_slots is bigger thannari2011-06-111-41/+62
| | | | | | HEAP_MIN_SLOTS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: remove an unused declaration.nagachika2011-06-091-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() fornagachika2011-06-091-1/+1
| | | | | | | | | type check to get rid of a double free when main Thread has singleton class. [ruby-core:36741] [Bug #4828] * thread.c (rb_obj_is_mutex): add a new utility function. * vm.c (rb_obj_is_thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (vm_xcalloc): use calloc provided by platforms.nobu2011-05-221-20/+46
| | | | | | fixes #4754 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Fix build on m68k by 'error: too few arguments toiwamatsu2011-05-201-1/+1
| | | | | | | function 'mark_locations_array''. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: add for internal use only.nobu2011-05-181-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace): an initializer must be a constant.naruse2011-03-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): allow GC parameter configuration bymatz2011-03-071-10/+48
| | | | | | | environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (thread_free): reset ruby_current_thread if it points theakr2011-01-121-1/+4
| | | | | | | | | | | thread to free. * gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if there is no current thread. [ruby-dev:43000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_GC): move back object_id to Kernel. [ruby-dev:42840]matz2010-12-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_GC): move #__id__ and #object_id to BasicObject.matz2010-12-171-2/+2
| | | | | | [ruby-dev:42778] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: parenthesize macro arguments.akr2010-12-141-17/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it isshyouhei2010-12-031-0/+6
| | | | | | | | | | | | | | | possible for an object to survive until its surrounding object space is about to be freed. Those objects, if any, remains not leaked for the rest of a process life. This is problematic because for instance a T_DATA object may have its own destructor to terminate something. * vm.c (ruby_vm_destruct): ruby_current_vm termination should be somewhere after rb_objspace_free for above reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (assign_heap_slot): fix fear of memory leak and memorymame2010-11-151-3/+7
| | | | | | violation. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (after_gc_sweep): remove unused variable.nobu2010-11-091-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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