aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (vm_xrealloc): add a few comment why we avoid realloc(ptr,0).kosaki2013-01-041-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust stylenobu2012-12-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_id_to_ref): add a macro to treat Bignum object id.shirosaki2012-12-221-2/+5
| | | | | | | | | | 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/trunk@38548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum onusa2012-12-201-1/+7
| | | | | | | | | LLP64 platform, such as 64bit Windows. reporeted by Heesob Park at [ruby-core:50255] [Bug #7454], and the fix is suggested by akr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_sigaltstack_size): new. calculate stack size forkosaki2012-12-151-1/+1
| | | | | | | | | | | | | | | sigsegv handler. enlarge value when x86 or x86_64 on Linux. Linux has very small MINSIGSTKSZ size (2048 bytes) and our sigsegv routine need 5KiB at least. [Bug #7141] * internal.h: add declaration of rb_sigaltstack_size(). * vm_core.h: remove ALT_STACK_SIZE definition. * signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with rb_sigaltstack_size(); * gc.c (Init_heap): ditto. * vm.c (th_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * revised r37993 to avoid SEGV/ILL in tests. In r37993, a methodshugo2012-12-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entry with VM_METHOD_TYPE_REFINED holds only the original method definition, so ci->me is set to a method entry allocated in the stack, and it causes SEGV/ILL. In this commit, a method entry with VM_METHOD_TYPE_REFINED holds the whole original method entry. Furthermore, rb_thread_mark() is changed to mark cfp->klass to avoid GC for iclasses created by copy_refinement_iclass(). * vm_method.c (rb_method_entry_make): add a method entry with VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_me) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * vm.c (rb_thread_mark): mark cfp->klass for iclasses created by copy_refinement_iclass(). * vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (getrusage_time): uses clock_gettime() withnari2012-12-051-1/+8
| | | | | | | CLOCK_PROCESS_CPUTIME_ID when available, which provides a 1ns precision on linux. [ruby-core:50495] [Bug #7500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (WeakMap): Add doc for internal reference, use lib/weakref.rbzzak2012-12-021-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: suppress warningsnobu2012-12-011-5/+5
| | | | | | | * gc.c (add_slot_local_freelist, slot_sweep, mark_locations_array): suppress unused-value warnings, even with valgrind enabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * revert r37993 to avoid SEGV in tests.shugo2012-11-301-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c : remove a unused function.nari2012-11-291-16/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_call_finalizer): finalize_deferred may free upnari2012-11-291-9/+3
| | | | | | | | | | 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_entry_make): add a method entry withshugo2012-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_def) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Documentation for GC, GC::Profiler, ObjectSpace, andzzak2012-11-291-76/+116
| | | | | | | ObjectSpace::WeakMap [ruby-core:50245] [Bug #7449] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_stat): prepre Symbol objects at first timeko12012-11-291-10/+25
| | | | | | | | to make it fast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_stat): GC.stat supports new informationko12012-11-291-52/+37
| | | | | | | | | | | * total_allocated_object: total allocated object number. * total_freed_object: total freed object number. Above two numbers are only accumulated and they will overflow (return to 0). Please use them as a hint. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: refactoring of rb_ary_delete_same()shirosaki2012-11-251-1/+1
| | | | | | | | | | | | | | | | * array.c (ary_resize_smaller): new function to resize array. * array.c (rb_ary_delete): refactoring to extract a function. * array.c (rb_ary_delete_same): refactoring. It renames function, reduces duplicated code and removes unused code. * gc.c (wmap_final_func): follow the above change. * internal.h (rb_ary_delete_same): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: refactoring to rename variablesshirosaki2012-11-241-14/+15
| | | | | | | | | | | | * gc.c (wmap_final_func): rename variables to clarify the meaning. In wmap2obj the key is WeakRef and the value is referenced object. In obj2wmap the key is referenced object and the value is an array of WeakRef. * gc.c (wmap_finalize): ditto. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix WeakRef finalizeshirosaki2012-11-241-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c (rb_ary_delete_same_obj): new function for WeakRef. This deletes same objects as item argument in the array. * internal.h (rb_ary_delete_same_obj): add a declaration. * gc.c (wmap_final_func): remove WeakRef object reference from the array. rb_ary_delete() is not usable because it uses rb_equal() to compare object references. * gc.c (wmap_finalize): remove recycled object references from weak map hash properly. How to get object reference from object id was wrong. st_delete() doesn't work properly if key and value arguments are same. The key of obj2wmap is referenced object and the value of obj2wmap is WeakRef array. * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the definition. * test/test_weakref.rb (TestWeakRef#test_not_reference_different_object, TestWeakRef#test_weakref_finalize): add tests for above. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rvert r37827 and r37828naruse2012-11-241-18/+15
| | | | | | | | | | | Revert "Fix finalize of WeakRef" This causes segv on rubyspec. http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121124T050101Z.log.html.gz you can reproduce by make test-rubyspec MSPECOPT='-V library/weakref' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wmap_finalize: refactoring to rename variablesshirosaki2012-11-241-14/+15
| | | | | | | | | | | | * gc.c (wmap_final_func): rename variables to clarify the meaning. In wmap2obj the key is WeakRef and the value is referenced object. In obj2wmap the key is referenced object and the value is an array of WeakRef. * gc.c (wmap_finalize): ditto. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix finalize of WeakRefshirosaki2012-11-241-9/+11
| | | | | | | | | | | | | | | | | | | | | * gc.c (wmap_final_func): remove WeakRef object reference from the array. * gc.c (wmap_finalize): remove recycled object references from weak map hash properly. How to get object reference from object id was wrong. st_delete() doesn't work properly if key and value arguments are same. The key of obj2wmap is referenced object and the value of obj2wmap is WeakRef array. * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the definition. * test/test_weakref.rb (TestWeakRef#test_not_reference_different_object): add a test for above. [ruby-core:49044] [Bug #7304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (is_swept_object): extract from is_dead_object().nari2012-11-221-4/+58
| | | | | | | | | | | * gc.c (rb_gcdebug_print_obj_condition): add the function for debug. This function shows some conditions of given object (e.g., marked, in heap, swept). * gc.c (rb_gcdebug_sentinel): add the function for debug. This function allow check to inadvertently free up an object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect): remove a duplicative probe.nari2012-11-211-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_clear): realloc profile records if its size isnari2012-11-211-1/+10
| | | | | | higher than the threshold, GC_PROFILE_RECORD_DEFAULT_SIZE * 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove2012-11-121-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: move immutable fields from struct heaps_slot and structnari2012-11-101-50/+41
| | | | | | | sorted_heaps_slot into struct heaps_header. Based on a patch from Sokolov Yura [Feature #6199][ruby-core:43592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: renamed from atomic.h to avoid header file name conflictngoto2012-11-091-1/+1
| | | | | | | | | 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/trunk@37604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix build when gcc is used and the platform's libc lacks alloca().knu2012-11-091-21/+0
| | | | | | | | | | | | | | | | * include/ruby/ruby.h (alloca), eval_intern.h (alloca), gc.c (alloca): Make alloca() globally available by moving the ultimate ifdef's to ruby/ruby.h. Gcc hides its builtin alloca() when compiling with -ansi, and linking thus fails on platforms that lack their own alloca() implementation in libc, which include OpenBSD and some ports of NetBSD. We use alloca() everywhere including from within third party C extentions, so alloca() must be made globally available. [Bug #7307] * addr2line.c (alloca): Replace the alloca() part with the ultimate ifdef's. [Bug #7307] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_record): don't define unused variables whennari2012-10-311-5/+10
| | | | | | GC_PROFILE_MORE_DETAIL is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_prof_mark_timer_stop): count is not initialized.nari2012-10-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: PRIuSIZEnobu2012-10-291-3/+3
| | | | | | | * gc.c (gc_profile_dump_on): use PRIuSIZE instead of 'zu'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result, gc_profile_report): use internal structureseregon2012-10-271-47/+43
| | | | | | to avoid allocations and progressively print the output for #report. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename it to a more fitting namenari2012-10-241-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix the function name which is not grammatically correct.nari2012-10-241-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (free_object_aquire): rename to match the behavior of thisnari2012-10-241-3/+3
| | | | | | function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect, gc_marks): move the location ofko12012-10-241-7/+6
| | | | | | | | | clear and restore rb_objspace_t::mark_func_data from garbage_collect() to gc_marks(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):ko12012-10-241-32/+19
| | | | | | | | | | | | | | | | | | | | internal object support. If given object `obj' has references to internal objects (such as T_NODE objects), then this method returns instances of `ObjectSpace::InternalObjectWrapper' instead of that internal objects. This instance contains a refereance to an internal object and you can check the type of internal object using `ObjectSpace::InternalObjectWrapper#type' method. Rdoc of `InternalObjectWrapper' is not prepared yet. * gc.c (rb_objspace_reachable_objects_from), gc.h: change an interface of 'rb_objspace_reachable_objects_from()' * gc.c, gc.h: add two APIs - rb_objspace_markable_object_p(obj): check markable or not. - rb_objspace_internal_object_p(obj): check internal or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: fix typos in documentation.eregon2012-10-201-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: add C APIs.nari2012-10-201-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,shugo2012-10-081-1/+1
| | | | | | | | vm_method.c: rename omod and overlaid modules to refinements. * eval.c (hidden_identity_hash_new): renamed from identity_hash_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: use markable_object_pnobu2012-10-061-2/+1
| | | | | | | * gc.c (gc_mark_children): use markable_object_p() and reduce duplicated code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix commentsnari2012-10-051-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r37091nari2012-10-051-3/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/objspace/objspace.c: add ObjectSpace#reachable_objects_from.ko12012-10-051-29/+111
| | | | | | | | | | | | | | | | | This method returns an array of objects referenced by given object. If given object is special objects such as true/false/nil/Fixnum etc then it returns nil. See rdoc for details. [ruby-core:39772] * test/objspace/test_objspace.rb: add a test for this method. * gc.c: add rb_objspace_reachable_objects_from(). To make this function, add several member `mark_func_data' to rb_objspace_t. If mark_func_data is not null, then gc_mark() calls mark_func_data::mark_func. * gc.h: export rb_objspace_reachable_objects_from(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (chain_finalized_object): remove to check a mark flag andnari2012-10-051-7/+3
| | | | | | | | | | marking since all objects are certainly unmarked with rest_sweep. * gc.c (rb_objspace_call_finalizer): remove to mark finalizable objects. The sweeping doesn't push T_ZOMBIE objects to the freelist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (init_heap): call init_mark_stack before to allocatenari2012-10-041-1/+2
| | | | | | | 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/trunk@37088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objectsnari2012-10-041-3/+1
| | | | | | at suitable point. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: self-referencing finalizersnobu2012-10-041-6/+19
| | | | | | | | * 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(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: use enum for debugging.nobu2012-10-041-53/+55
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e