summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2015-06-25* vm_method.c: make a rb_method_definition_t data (def) *after* makingko1
a rb_method_entry_t data (me). Normally, `me' points `def'. Some Ruby objects pointed from `def' and objects are marked by `me' (mark_method_entry() in gc.c). However, `def' is built before making a `me', then nobody can mark objects pointed from `def' before making (and pointing from) `me'. I hope this patch solve #11244. * vm_method.c: remove `rb_' prefix from some static functions. * method.h (rb_method_entry_create): constify * gc.c (mark_method_entry): add checking `def' and `def->body.iseq.iseqptr' availability because they can be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24* gc.c (obj_info, method_type_name): show method type name in a stringko1
instead of a number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24* gc.c (obj_info): show more details for T_IMEMO/imemo_ment.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24* gc.c (RGENGC_OBJ_INFO, obj_info): add a macro to enable/disableko1
rich obj_info() output. At the default, the value of RGENGC_OBJ_INFO is (RGENGC_DEBUG | RGENGC_CHECK_MODE). * gc.c (RGENGC_OBJ_INFO): force enable it to debug #11244. * gc.c (gc_mark_ptr): print more details with obj_info(). * gc.c (gc_mark_children): remove useless debug prints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24* gc.c (gc_mark_children): add additional debug code for #11244.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24* gc.c (gc_mark_ptr): add a check code for #11244.ko1
It should be removed later. But we can remain this check because it is only a branch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24internal.h: rb_fstring_litnobu
* internal.h (rb_fstring_lit): new macro to make a fstring from a string literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18* include/ruby/ruby.h: $SAFE=2 is now obsolete.hsbt
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17* include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code for $SAFE=3 * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb test/ruby/test_thread.rb: remove tests for $SAFE=3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14[DOC]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-07* gc.c (obj_info): print method id for T_IMEMO/ment.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05* gc.c: remove struct mark_tbl_arg and pass objspace directlyko1
to avoid indirect access overhead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03* method.h: introduce rb_method_refined_t for refined method entry.ko1
* class.c (move_refined_method): catch up this fix. * gc.c (mark_method_entry): ditto. * vm_eval.c (vm_call0_body): ditto. * vm_insnhelper.c (vm_call_method): ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03variable.c: remove generic ivar support for special constantsnormal
Special constants are all frozen since [Feature #8923] and cannot support ivars. Remove some unused code we had for supporting them. * variable.c (special_generic_ivar): remove flag (givar_i, rb_mark_generic_ivar_tbl): remove functions (rb_free_generic_ivar, rb_ivar_lookup, rb_ivar_delete, generic_ivar_set, rb_ivar_set, rb_ivar_defined, rb_copy_generic_ivar, rb_ivar_foreach, rb_ivar_count, rb_obj_remove_instance_variable): adjust for lack of ivar support in special constants * test/ruby/test_variable.rb: test ivars for special consts * internal.h: remove rb_mark_generic_ivar_tbl decl * gc.c (gc_mark_roots): remove rb_mark_generic_ivar_tbl call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02* method.h: remove rb_method_iseq_t::iseqval.ko1
While making a r50728, iseqval is needed (to mark correctly), but now just iseqptr is enough. * class.c: catch up this fix. * gc.c: ditto. * proc.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02* method.h: make rb_method_entry_t a VALUE.ko1
Motivation and new data structure are described in [Bug #11203]. This patch also solve the following issues. * [Bug #11200] Memory leak of method entries * [Bug #11046] __callee__ returns incorrect method name in orphan proc * test/ruby/test_method.rb: add a test for [Bug #11046]. * vm_core.h: remvoe rb_control_frame_t::me. me is located at value stack. * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes because method entries are simple VALUEs. * method.h: Now, all method entries has own independent method definititons. Strictly speaking, this change is not essential, but for future changes. * rb_method_entry_t::flag is move to rb_method_definition_t::flag. * rb_method_definition_t::alias_count is now rb_method_definition_t::alias_count_ptr, a pointer to the counter. * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to search the current method entry from value stack. * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01* gc.c (gc_mark_children): remove a garbage characterko1
introduced at the last commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01* vm_method.c (rb_method_entry_make): do not show warning messageko1
when method_entry is an alias. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-31* gc.c , gc.h (rb_obj_info): export obj_info(VALUE) for debugging.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-30* method.h: add VM_METHOD_TYPE_ALIAS rb_method_definition_t::typeko1
to fix [Bug #11173]. Now, inter class/method alias creates new method entry VM_METHOD_TYPE_ALIAS, which has an original method entry. * vm_insnhelper.c (find_defiend_class_by_owner): added. Search corresponding defined_class from owner class/module. * vm_method.c (rb_method_entry_get_without_cache): return me->klass directly for defined_class. Now, no need to check me->klass any more. * vm_method.c (method_entry_set0): separated from method_entry_set(). * vm_method.c (rb_alias): make method entry has VM_METHOD_TYPE_ALIAS. * vm_method.c (release_method_definition): support VM_METHOD_TYPE_ALIAS. * vm_method.c (rb_hash_method_definition): ditto. * vm_method.c (rb_method_definition_eq): ditto. * vm_method.c (release_method_definition): ditto. * vm_insnhelper.c (vm_call_method): ditto. * vm_insnhelper.c (vm_method_cfunc_entry): ditto. * vm_eval.c (vm_call0_body): ditto. * gc.c (mark_method_entry): ditto. * proc.c (method_def_iseq): ditto. * proc.c (method_cref): ditto. * proc.c (rb_method_entry_min_max_arity): ditto. * test/ruby/test_alias.rb: add tests. * test/ruby/test_module.rb: fix a test to catch up current behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27gc.c: mark stress_to_classnobu
* gc.c (gc_mark_roots): stress_to_class is also a GC root. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27gc.c: stress_to_classnobu
* gc.c (newobj_of): debug feature to fail allocation of particular classes. * gc.c (rb_gcdebug_add_stress_to_class): add classes to the list. * gc.c (rb_gcdebug_remove_stress_to_class): remove classes from the list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20ruby.h: warn old namesnobu
* include/ruby/ruby.h (rb_data_typed_object_alloc), (rb_data_object_alloc): warn use of old names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19ruby.h: add old namesnobu
* include/ruby/ruby.h (rb_data_typed_object_alloc), (rb_data_object_alloc): add old names for source level backward compatibilities. * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add aliases for binary level backward compatibilities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18gc.c: remove ifdefnobu
* gc.c (obj_info): remove needless ifdef, and adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16gc.c: rename alloc as wrapnobu
* gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename alloc as wrap. these functions do not allocate data pointers but just wrap the given pointers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10ruby.h: fix possible memory leaknobu
* include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct): allocate wrapper data object before allocating DATA_PTR to get rid of possible memory leak when the former failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10gc.c: never call dmark for NULLnobu
* gc.c (gc_mark_children): call dmark function for non-NULL pointers only, so that DATA_PTR can be NULL safely now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-26gc.c: event hook thread argumentnobu
* gc.c (gc_event_hook_body): move th to an argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23* gc.c (gc_mark_roots): fox to work PRINT_ROOT_TICKS.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-15* doc/contributors.rdoc: fix a typo. Patch by @davydovantonhsbt
[fix GH-872][ci skip] * doc/syntax/methods.rdoc: ditto. * ext/digest/sha2/sha2.c: ditto. * ext/socket/ipsocket.c: ditto. * ext/tk/*: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14* gc.c: [DOC] Improve documentation for ObjectSpace.count_objectszzak
with regards to `:TOTAL` key, with patch by @schneems [Fixes GH-871] https://github.com/ruby/ruby/pull/871 [Bug #11067] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12* gc.c: Document require name for ObjectSpace methods.hsbt
[ci skip][fix GH-860] Patch by @schneems git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-29* gc.c (objspace_allrefs_destruct_i): fix a typo.hsbt
[Bug #11013] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-27internal.h: rb_imemo_new_debugnobu
* internal.h (rb_imemo_new_debug): pretend rb_imemo_new. * gc.c (rb_imemo_new_debug): share with rb_imemo_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-24* gc.c (gc_writebarrier_generational): fix messages for rb_bug().ko1
Remove `rb_' prefix. * gc.c (gc_writebarrier_incremental): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20* gc.c (obj_info): obj_info() can receive internal objects.ko1
* gc.c (check_rvalue_consistency): obj_info() returns const char *. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20revert r50031 because it includes unexpected patchko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20* gc.c (obj_info): obj_info() can receive internal objects.ko1
* gc.c (check_rvalue_consistency): obj_info() returns const char *. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20* gc.c (obj_info): show class name and T_DATA type_name.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c (rb_copy_wb_protected_attribute): `dest' can be WB unprotected.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c (rb_copy_wb_protected_attribute): demote `dest' object.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c, internal.h: export rb_gc_verify_internal_consistency().ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c (obj_info): show allocation site if GC_DEBUG is not 0.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.ko1
* skip on incremental marking because not sure what happen :p * rb_gc_writebarrier_remember() is enough to mark children. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19* gc.c (rb_copy_wb_protected_attribute): need demote for old objects.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18* internal.h (IMEMO_DEBUG): added.ko1
* internal.h: remove unused FL_IMEMO_MARK_V[0-3]. * gc.c (rb_imemo_new_debug): added. * gc.c (obj_info): show imemo type name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18* gc.c (RGENGC_OLD_NEWOBJ_CHECK): add check mechanism.ko1
If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects (not new objects) periodically. Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are created. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18* gc.c (check_rvalue_consistency): refactoring.ko1
* not inline on RGENGC_CHECK_MODE > 0. * check SPECIAL_CONST_P(obj) first. * add a check that remembered_bit is only TRUE when old (age == 3). * gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit. remembered_bit should be TRUE only for old (age == 3) objects. Actually there are no effect because demoted objects will be uncollectible WB unprotected objects (marked at the begginig of every minor GC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18* gc.c: rename terminologies.ko1
* long_lived -> uncollectible: because this bitmap does not mean "long lived objects in past", but means "prohibit collection thse objects until next major GC". Uncollectible objects consist of two types objects, one is old objects (WB protected objects which age == 3) and another is uncollectible WB unprotected objects which are referred from old objects * remembered_wb_unprotected_objects -> uncollectible_wb_unprotected_objects: because uncollectible objects does not mean remembered objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e