summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2014-04-30* gc.c (gc_after_sweep): suppress unnecessary expanding heap.nari
Tomb heap pages are freed pages here, so expanding heap is not required. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-28* gc.c: This argument must be a pointer.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-28* gc.c: Fix typos. These are undefined variables.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21* gc.c (objspace_malloc_increase): don't cause GC by malloc_increaseko1
when memop type is MEMOP_TYPE_REALLOC. GC at realloc is not well maintained. We need a time to make it safe. [ruby-dev:48117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: full mark after malloc/reallocnobu
* gc.c (objspace_malloc_increase): run full mark if 0x04 bit is set in ruby_gc_stress. [ruby-core:62103] [Feature #9761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: GC.stress after reallocnobu
* gc.c (objspace_malloc_increase): run GC after realloc not only malloc and calloc by GC.stress. [ruby-core:62103] [Feature #9761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-21gc.c: fixnum GC stressnobu
* gc.c (garbage_collect_body): name magic numbers. * gc.c (gc_stress_set): GC.stress accepts not only boolean but also Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-19gc.c: drop special case for big hash/arraynormal
* gc.c (rb_gc_writebarrier): drop special case for big hash/array [Bug #9518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-17gc.c: suppress a warningnobu
* gc.c (get_envparam_size): suppress a warning by char-subscripts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-11gc.c: no newline to rb_bugnobu
* gc.c: no newline in messages for rb_bug, it outputs a newline after the message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10* gc.c (gc_verify_internal_consistency): move lines and enableko1
allrefs_dump() on RGENGC_CHECK_MODE >= 4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10* gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debugko1
message when RGENGC_CHECK_MODE == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: check rgengc_report argumentnobu
* gc.c (rgengc_report): use __VA_ARGS__ if possible. * gc.c (rgengc_report_body): check argument. * gc.c (heap_page_allocate): fix missing argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: do nothing unless USE_RGENGCnobu
* gc.c (gc_verify_internal_consistency): always do nothing unless USE_RGENGC is set, no local variable needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-10gc.c: adjust indentnobu
* gc.c (RVALUE_DEMOTE_FROM_YOUNG, RVALUE_DEMOTE_FROM_OLD): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09Add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09* gc.c (mark_current_machine_context): Call SET_STACK_END.akr
This reverts a hunk of r40703 by ko1. This fixes [ruby-dev:48098] [Bug #9717]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-08* gc.c: rename `RGENGC_THREEGEN' to `RGENGC_AGE2_PROMOTION'.ko1
* gc.c (rgengc_rememberset_mark): don't promote, but remain in remember set for infant objects. * gc.c (RVALUE_PROMOTE_INFANT, RVALUE_PROMOTE_YOUNG): count numbers in these functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-02* gc.c, gc.h (rb_objspace_each_objects_without_setup):ko1
Add a new (hidden) C-API to iterate objspace snapshot. This API is not safe to call any C-APIs in a given callback function. Be careful to use this C-API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-30gc.c: avoid inadvertent pin-downnobu
* gc.c (gc_info_decode): get rid of inadvertent dynamic symbol pin-down, and preserve encoding in error messages. also should not use RSTRING_PTR macro on function calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-29* gc.c (gc_before_sweep): cap `malloc_limit' toko1
gc_params.malloc_limit_max. It can grow and grow with such case: `loop{"a" * (1024 ** 2)}' [Bug #9687] This issue is pointed by Tim Robertson. http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26* parse.y: support Symbol GC. [ruby-trunk Feature #9634]nari
See this ticket about Symbol GC. * include/ruby/ruby.h: Declare few functions. * rb_sym2id: almost same as old SYM2ID but support dynamic symbols. * rb_id2sym: almost same as old ID2SYM but support dynamic symbols. * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not pin down a dynamic symbol. Declare a new struct. * struct RSymbol: represents a dynamic symbol as object in Ruby's heaps. Add few macros. * STATIC_SYM_P: check a static symbol. * DYNAMIC_SYM_P: check a dynamic symbol. * RSYMBOL: cast to RSymbol * gc.c: declare RSymbol. support T_SYMBOL. * internal.h: Declare few functions. * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this function at a sweep phase. * rb_str_dynamic_intern: convert a string to a dynamic symbol. * rb_check_id_without_pindown: not pinning function. * rb_sym2id_without_pindown: ditto. * rb_check_id_cstr_without_pindown: ditto. * string.c (Init_String): String#intern and String#to_sym use rb_str_dynamic_intern. * template/id.h.tmpl: use LSB of ID as a flag for determining a static symbol, so we shift left other ruby_id_types. * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to avoid pinning. * load.c: use xx_without_pindown function at creating temporary ID to avoid pinning. * object.c: ditto. * sprintf.c: ditto. * struct.c: ditto. * thread.c: ditto. * variable.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-24gc.c: Fix up default GC params by @csfrancis [fix GH-556]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-21* gc.c: [DOC] Fix call-seq for GC.start by @jasonrclark [Fixes GH-572]zzak
https://github.com/ruby/ruby/pull/572 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-20* gc.c (objspace_malloc_increase): should not invokeko1
garbage_collect_with_gvl() here on non-ruby threads. Should just ignore the malloc_increase. This issue is pointed by Eric Wong [ruby-core:61519]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-15gc.c (objspace_xcalloc): fix GC accountingnormal
This hopefully works on all platforms with malloc_usable_size. This may also trigger bugs in places which did not expect GC, too; so maybe some existing code will need RB_GC_GUARD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-15object.c: [DOC] merge rdocnobu
* gc.c (rb_obj_id): remove unused rdoc. * object.c (rb_obj_hash): [DOC] merge unused rdoc from rb_obj_id() in gc.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-14[DOC] add links to `Object#hash`nobu
add links to `Object#hash` to each #`hash` methods rdocs. [Fixes GH-567] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01gc.c: simplify conditionnormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01gc.c: fix build for testing w/o RGenGCnormal
* gc.c (ruby_gc_set_params): fix building without RGenGC git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27adjust indent and stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-26* gc.c (heap_pages_free_unused_pages): check tomb page availabilityko1
at first. And return immediately if we don't touch sorted list any more. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22gc.c: suppress warningsnobu
* gc.c (gc_marks): cast explicitly to suppress warnings by VC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-20gc.c: RB_GC_GUARD should be robust enough for any compilernormal
* include/ruby/ruby.h (RB_GC_GUARD): use rb_gc_guarded_ptr_val on non-GCC/MSC * gc.c (rb_gc_guarded_ptr_val): rename and adjust argument. RB_GC_GUARD should be robust enough for any compiler. [ruby-core:60816] [Bug #7805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-17* gc.c (get_envparam_double): fix a warning message.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-17* gc.c: introduce new environment variableko1
"RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR" to control major/minor GC frequency. Do full GC when the number of old objects is more than R * N where R is this factor and N is the number of old objects just after last full GC. * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15* internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.akr
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS. (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX. (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT. (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN. (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN. (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P. (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P. (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG. (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK. (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT. (BIGNUM_LEN): Renamed from RBIGNUM_LEN. (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS. (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT. * bignum.c: Follow the above change. * gc.c: Ditto. * marshal.c: Ditto. * math.c: Ditto. * numeric.c: Ditto. * random.c: Ditto. * rational.c: Ditto. * sprintf.c: Ditto. * ext/-test-/bignum/bigzero.c: Ditto. * ext/-test-/bignum/intpack.c: Ditto. * ext/bigdecimal/bigdecimal.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14* include/ruby/intern.h,akr
include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [ruby-core:60581] [Feature #9502] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14gc.c: unit suffixnobu
* gc.c (get_envparam_size): accept unit suffix 'k', 'm', and 'g'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-08* gc.c, gc.h (rb_objspace_marked_object_p): added.ko1
This function *ONLY* works just after marking phase, before any sweeping. This function is highly depending current GC implementation and can be removed future version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07gc.c: ignore empty stringsnobu
* gc.c (get_envparam_size, get_envparam_double): silently ignore empty strings, without any warnings regardless $VERBOSE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07gc.c: revert returnnobu
* gc.c (get_envparam_size): revert `return` statement removed by accident. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07gc.c: use size_tnobu
* gc.c (ruby_gc_params_t, get_envparam_size): use size_t for integer environment parameters for sizes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06gc.c: check numeric stringnobu
* gc.c (get_envparam_int, get_envparam_double): check invalid string as numeric. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06* gc.c (get_envparam_int): correct warning messsages.ko1
* gc.c (get_envparam_double): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06* gc.c (get_envparam_int): don't accept a value equals to lowerboundko1
(changed by last commit) because "" or "foo" (not a number) strings are parsed as 0. They should be rejected. * gc.c (get_envparam_double): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06* gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,ko1
then set objspace->rgengc.oldmalloc_increase_limit. Without this fix, the env variable RUBY_GC_OLDMALLOC_LIMIT does not work. * gc.c (get_envparam_int): accept a value equals to lowerbounds. * gc.c (get_envparam_double): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05* gc.c (gc_mark_children): STR_ASSOC is no longer available.ko1
Reported by @nagachika. http://d.hatena.ne.jp/nagachika/20140204 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28vm_core.h: rb_thread_struct::machinenobu
* vm_core.h (rb_thread_struct): aggregate cpu stuff into a struct, so that a debugger can show its content at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19* gc.c: fix typo by @windwiny [fix GH-506]hsbt
* proc.c: ditto * variable.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e