Fix SEGV during finilize of WeakRef on Solaris (though the SEGV
could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order
(RUBY_GC_HEAP_GROWTH_SLOTS): s/factor/number of slots/
* man/ruby.1: add section for GC environment variables
[Feature #10197]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This prevents excessive memory growth when a WeakRef
is repeatedly created
* gc.c (define_final0): avoid duplicate blocks
[Bug #10537]
* test/test_weakref.rb (test_repeated_object_leak): new test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Class and Module objects can be living long life.
* iseq.c: Same for ISeq objects.
* gc.c (RVALUE_AGE_RESET): added.
* gc.c (newobj_of): allow to generate (age != 0) objects.
* gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected
objects.
* include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended
flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use 0 for rb_data_type_t::reserved instead of NULL, since its type
may be changed in the future and possibly not a pointer type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(malloc_increase) to make GC incrementally.
This change can increase memory consumption. Report us if you find
any problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (default_proc_for_compat_func): check arguments number and
type, and get rid of reentering this default proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
From Ruby 2.2, keys of GC.stat are changed [Feature #9924].
To provide compatible layer, GC.stat add a default_proc
(if default_proc of given Hash object is not set).
At first use of this compatible layer of interpreter process,
show a warning message like that:
program: GC.stat[:total_allocated_object]
warning message: "warning: GC.stat keys were changed from Ruby
2.1. In this case, you refer to obsolete `total_allocated_object'
(new key is `total_allocated_objects').
Please check <https://bugs.ruby-lang.org/issues/9924>
for more information."
Pleaes correct my English message :)
* hash.c (rb_hash_set_default_proc): export (in internal).
* internal.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to hide unused codes.
* gc.c: similar to GC_ENABLE_LAZY_SWEEP.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Before this patch, gc_marks_step() marks (white -> grey) fixed
number objects. However, this strategy does not fit practical
cases, for example too slow to make progres.
This patch changes this strategy how many objects the
gc_marks_step() should handle.
We can estimate how many times gc_marks_step() is called during
this major marking (== C) with the free slot number in pooled
pages. We also can estimate the living object number (== L)
using last marked_slots value. We can solve this problem (how
many objects should be process in gc_marks_step()) by L/C.
* gc.c (rb_objspace_t): add rb_objspace_t::rincgc::pooled_sltos and
step_slots.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_objspace_t:🎏:during_incremental_marking is not defined
when GC_ENABLE_INCREMENTAL_MARK is 0.
* gc.c (will_be_incremental_marking, is_full_marking): similar fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use `&&' with GC_ENABLE_INCREMENTAL_MARK intead of using
#if/#else/#endif.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_sweep_rest): sweep rest pages regardless of whether
lazy sweep is enabled or not. based on the patch by Masahiro
Ide at [ruby-dev:48706]. [Bug #10431]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
marking.
(rb_gc_mark_machine_stack) [__mc68000__]: Also handle it here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
make and register special exceptions.
* vm.c (rb_vm_mark): do not need to mark special exceptions
because they are registerd by rb_gc_register_mark_object().
* eval.c (Init_eval): use rb_vm_register_special_exception().
* gc.c (Init_GC): ditto.
* proc.c (Init_Proc): ditto.
* thread.c (Init_Thread): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This function is similar to rb_gc_mark_locations(), but not
conservertive.
* internal.h: ditto.
* vm.c (env_mark): use rb_gc_mark_values() because env values should
be Ruby VALUEs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_mark): add gc_mark_ptr() to skip is_markable_object()
check. gc_mark_maybe() can use gc_mark_ptr() directly because
passed pointer is checked by is_pointer_to_heap().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (should_be_callable): preserve encoding of class name in
error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ref: [Feature #9924]
* test/ruby/test_gc.rb: add constraints test for gc stat information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e