summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2013-06-26revert r41628 because it causes memory error on mswin.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25merge revision(s) 41325: [Backport #8554]usa
* gc.c: Fixup around GC by MALLOC. Add allocate size to malloc_increase before GC for updating limit in after_gc_sweep. Reset malloc_increase into garbage_collect() for preventing GC again soon. this backport patch is written by nari. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25Commit miss, revert previous commit.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25merge revision(s) 41325: [Backport #8554]usa
* gc.c: Fixup around GC by MALLOC. Add allocate size to malloc_increase before GC for updating limit in after_gc_sweep. Reset malloc_increase into garbage_collect() for preventing GC again soon. this backport patch is written by nari. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-22merge revision(s) 32688,33309,33408,33864,35874,38012: [Backport #7832]usa
* vm_method.c (rb_gc_mark_unlinked_live_method_entries): remove unused variables. * vm_insnhelper.c (vm_call_cfunc): suppress a warning. note that `volatile type *var' doesn't make var itself volatile. * vm_insnhelper.c (vm_call_cfunc): remove useless hack. * regparse.c (onig_number_of_names): suppress a warning. * gc.c : remove a unused function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-15merge revision(s) 38010: [Backport #7452]usa
* gc.c (rb_objspace_call_finalizer): finalize_deferred may free up a object which is reachable from a part after this function, e.g. ruby_vm_destruct(). [ruby-dev:46647] [Bug #7452] * test/ruby/test_gc.rb (test_finalizing_main_thread): add a test for above. * test/rdoc/test_rdoc_servlet.rb: Tets for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25merge revision(s) 38548:usa
* gc.c (obj_id_to_ref): add a macro to treat Bignum object id. This follows the change r38493. * gc.c (id2ref): fix for working fine with Bignum object id on x64 Windows. * gc.c (wmap_finalize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21merge revision(s) 38493,38539: [Backport #7454]usa
* gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on LLP64 platform, such as 64bit Windows. reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the fix is suggested by akr. * object.c (rb_obj_hash): shouldn't assume object_id can be long. based on a patch by Heesob Park at [ruby-core:51060]. cf. [Backport #7454] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19merge revision(s) 36593: [Backport #7407]usa
* gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821] * test/ruby/test_gc.rb: add test-case for this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-15merge revision(s) 35080: [Backport #7353]usa
* gc.c (free_method_entry_i): method entry may be in unlinked_method_entry_list. [ruby-core:43383][Bug #6171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-14merge revision(s) 37604:usa
* ruby_atomic.h: renamed from atomic.h to avoid header file name conflict on Solaris 10. [ruby-dev:46414] [Bug #7287] * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from atomic.h to ruby_atomic.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13merged revision(s) 37075,37076,37082,37083,37088: [Backport #7123]usa
* gc.c: Use the non-recursive marking instead of recursion. The recursion marking of CRuby needs checking stack overflow and the fail-safe system, but these systems not good at partial points, for example, marking deep tree structures. [ruby-dev:46184] [Feature #7095] * configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by checking stack overflow of marking. * win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto. * gc.c (free_stack_chunks): it is used only when per-VM object space is enabled. * gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers before run finalizers, to fix SEGV from btest on 32bit. * gc.c (gc_mark_stacked_objects): extract from gc_marks(). * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects at suitable point. * gc.c (init_heap): call init_mark_stack before to allocate altstack. This change avoid the stack overflow at the signal handler on 32bit, but I don't understand reason... [Feature #7095] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22merge revision(s) 34719,34720: [Backport #6059]naruse
* gc.c : remove gc_clear_mark_on_sweep_slots() and use rest_sweep() instead of it, because some dead objects might be marked in next the mark phase by false pointers. [ruby-core:42672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15merge revision(s) 34629,34630:naruse
* cont.c (rb_fiber_reset_root_local_storage): add a new function to restore rb_thread_t::local_storage. * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to prevent fibers from destroy. * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing objspace. * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber): add prototypes. * vm.c (ruby_vm_destruct): reset main thread's local_storage before free main thread. rb_thread_t::local_storage is replaced by fiber's local storage when forked from fiber, and it should be already freed when the fiber was destroyed. * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork from fiber. when the fiber was destroyed. [ruby-core:41456] [Bug #5700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15merge revision(s) 34261,34351:nobu
------------------------------------------------------------------------ r34261 | nobu | 2012-01-10 15:52:24 +0900 (Tue, 10 Jan 2012) | 2 lines * gc.c (HEAP_OBJ_LIMIT): suppress narrowing down warning from gcc 4.2. ------------------------------------------------------------------------ * include/ruby/ruby.h (FIXNUM_P): simple flag should be int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14merge revision(s) 33500,33501:usa
* gc.c (rb_gc_set_params): set parameters always. [ruby-dev:44648] [Bug #5467] * gc.c (initial_params): pack in a struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07merge revision(s) 34250:ayumin
* gc.c (run_finalizer): clear rb_thread_t::errinfo when ignore an exception under rb_protect(). [ruby-dev:45113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-09merges r33379 and r33395 from trunk into ruby_1_9_3.yugui
-- * gc.c (rb_gc_set_params): output GC parameter change messages only if -w/-v options are specified. these messages are output to stderr, not to stdout. [ruby-core:39795] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. -- * gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-08merge revision(s) 33379:kosaki
* gc.c (rb_gc_set_params): output GC parameter change messages only if -w/-v options are specified. these messages are output to stderr, not to stdout. [ruby-core:39795] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-08merge revision(s) 33368:kosaki
* gc.c (add_heap_slots, init_heap): reset heaps_inc zero when heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS. [ruby-core:39777] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to enable pass environemnt variables to child process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-12* backport r32894 from trunk.nari
* gc.c (gc_lazy_sweep): if sweep target slots are not found, we 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/branches/ruby_1_9_3@32946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-11merge revision(s) 32821:kosaki
------------------------------------------------------------------------ r32821 | naruse | 2011-08-03 00:39:10 +0900 (Wed, 03 Aug 2011) | 1 line Refix r32815. ------------------------------------------------------------------------ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-11* backport r32815 from trunk.kosaki
* gc.c (init_heap): allocate sigaltstack after heaps are allocated. [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/branches/ruby_1_9_3@32933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28* backport r32669 from trunk.mame
* proc.c (struct METHOD), gc.c (gc_marks), vm_method.c (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/branches/ruby_1_9_3@32728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 * gc.c: Improve documentationdrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07* gc.c: change water_mark value value that may callnari
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
2011-06-17* internal.h: declare internal functions here.akr
* 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
2011-06-16* thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.kosaki
* 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
2011-06-15* gc.c: fix a regression by r31690 on AIX because AIX mallockosaki
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
2011-06-14* gc.c (rb_gc_set_params): call initial_expand_heap ifnari
initial_heap_min_slots is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-14* gc.c: use size_t.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-12* atomic.h (ATOMIC_OR): _InterlockedOr is not available on migw.nobu
* 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
2011-06-11* gc.c: expand heap if initial_heap_min_slots is bigger thannari
HEAP_MIN_SLOTS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* gc.c: remove an unused declaration.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() fornagachika
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
2011-05-22* gc.c (vm_xcalloc): use calloc provided by platforms.nobu
fixes #4754 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-20* gc.c: Fix build on m68k by 'error: too few arguments toiwamatsu
function 'mark_locations_array''. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* internal.h: add for internal use only.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_objspace): an initializer must be a constant.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_gc_set_params): allow GC parameter configuration bymatz
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
2011-01-12* vm.c (thread_free): reset ruby_current_thread if it points theakr
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
2010-12-22* gc.c (Init_GC): move back object_id to Kernel. [ruby-dev:42840]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-17* gc.c (Init_GC): move #__id__ and #object_id to BasicObject.matz
[ruby-dev:42778] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-14* gc.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-03* gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it isshyouhei
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
2010-11-15* gc.c (assign_heap_slot): fix fear of memory leak and memorymame
violation. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-09* gc.c (after_gc_sweep): remove unused variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-04* gc.c (rb_newobj): force garbage_collect() if GC.stress == true.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-04* gc.c (run_final): do not need argument obj.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-04* gc.c (run_final): do not need argument obj.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e