aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* gc.c: no newline to rb_bugnobu2014-04-111-7/+7
| | | | | | | * 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
* * gc.c (gc_verify_internal_consistency): move lines and enableko12014-04-101-79/+89
| | | | | | | | allrefs_dump() on RGENGC_CHECK_MODE >= 4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debugko12014-04-101-1/+1
| | | | | | | | message when RGENGC_CHECK_MODE == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: check rgengc_report argumentnobu2014-04-101-3/+8
| | | | | | | | | | * 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
* gc.c: do nothing unless USE_RGENGCnobu2014-04-101-2/+2
| | | | | | | * 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
* gc.c: adjust indentnobu2014-04-101-2/+2
| | | | | | | * 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
* Add comment.akr2014-04-091-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (mark_current_machine_context): Call SET_STACK_END.akr2014-04-091-0/+1
| | | | | | | | 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
* * gc.c: rename `RGENGC_THREEGEN' to `RGENGC_AGE2_PROMOTION'.ko12014-04-081-42/+58
| | | | | | | | | | | * 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
* * gc.c, gc.h (rb_objspace_each_objects_without_setup):ko12014-04-021-0/+10
| | | | | | | | | | 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
* gc.c: avoid inadvertent pin-downnobu2014-03-301-4/+6
| | | | | | | | * 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
* * gc.c (gc_before_sweep): cap `malloc_limit' toko12014-03-291-1/+1
| | | | | | | | | | | | 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
* * parse.y: support Symbol GC. [ruby-trunk Feature #9634]nari2014-03-261-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* gc.c: Fix up default GC params by @csfrancis [fix GH-556]hsbt2014-03-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: [DOC] Fix call-seq for GC.start by @jasonrclark [Fixes GH-572]zzak2014-03-211-3/+3
| | | | | | | 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
* * gc.c (objspace_malloc_increase): should not invokeko12014-03-201-2/+2
| | | | | | | | | | 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
* gc.c (objspace_xcalloc): fix GC accountingnormal2014-03-151-0/+2
| | | | | | | | 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
* object.c: [DOC] merge rdocnobu2014-03-151-17/+0
| | | | | | | | | * 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
* [DOC] add links to `Object#hash`nobu2014-03-141-0/+2
| | | | | | | 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
* gc.c: simplify conditionnormal2014-03-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix build for testing w/o RGenGCnormal2014-03-011-1/+1
| | | | | | * 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
* adjust indent and stylenobu2014-02-271-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (heap_pages_free_unused_pages): check tomb page availabilityko12014-02-261-18/+20
| | | | | | | | | 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
* gc.c: suppress warningsnobu2014-02-221-2/+2
| | | | | | * 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
* gc.c: RB_GC_GUARD should be robust enough for any compilernormal2014-02-201-2/+6
| | | | | | | | | | * 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
* * gc.c (get_envparam_double): fix a warning message.ko12014-02-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: introduce new environment variableko12014-02-171-4/+16
| | | | | | | | | | | | | "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
* * internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.akr2014-02-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* * include/ruby/intern.h,akr2014-02-141-6/+0
| | | | | | | | | | | | | | | | | | | | | 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
* gc.c: unit suffixnobu2014-02-141-1/+24
| | | | | | * 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
* * gc.c, gc.h (rb_objspace_marked_object_p): added.ko12014-02-081-0/+11
| | | | | | | | | | | 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
* gc.c: ignore empty stringsnobu2014-02-071-2/+2
| | | | | | | * 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
* gc.c: revert returnnobu2014-02-071-0/+1
| | | | | | | * 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
* gc.c: use size_tnobu2014-02-071-31/+33
| | | | | | | * 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
* gc.c: check numeric stringnobu2014-02-061-2/+19
| | | | | | | * 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
* * gc.c (get_envparam_int): correct warning messsages.ko12014-02-061-3/+3
| | | | | | | | * gc.c (get_envparam_double): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (get_envparam_int): don't accept a value equals to lowerboundko12014-02-061-2/+2
| | | | | | | | | | (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
* * gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,ko12014-02-061-4/+9
| | | | | | | | | | | | 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
* * gc.c (gc_mark_children): STR_ASSOC is no longer available.ko12014-02-051-2/+1
| | | | | | | | | 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
* vm_core.h: rb_thread_struct::machinenobu2014-01-281-9/+9
| | | | | | | * 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
* * gc.c: fix typo by @windwiny [fix GH-506]hsbt2014-01-191-3/+3
| | | | | | | * proc.c: ditto * variable.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix doc typotmm12014-01-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Oups, symbols are immediates toomarcandre2014-01-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Supplement object_id's rdoc for immediate and frozen string litteralsmarcandre2014-01-091-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Fix and remove outdated rdoc for object_idmarcandre2014-01-091-6/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_gc_set_params): don't show obsolete warnings forko12013-12-211-5/+7
| | | | | | | | | | RUBY_FREE_MIN/RUBY_HEAP_MIN_SLOTS if RUBY_GC_HEAP_FREE_SLOTS/RUBY_GC_HEAP_INIT_SLOTS are given. [Bug #9276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (heap_get_freeobj): improve hot path performance.ko12013-12-191-11/+16
| | | | | | | | | | * gc.c (heap_get_freeobj_from_next_freepage): replace with heap_get_freepage(). It returns freeobj instead of freepage. This is not on hot path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_of): don't need to RBASIC_SET_CLASS() which includes WBko12013-12-191-1/+1
| | | | | | | | here because created obj is always YOUNG/INFANT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: remove redundant freelist assignmenttmm12013-12-181-1/+1
| | | | | | | * gc.c (heap_get_freeobj): remove redundant assignment. heap->freelist is set after the while() loop already. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect_body): lazy_sweep setting should workko12013-12-181-7/+5
| | | | | | | | without USE_RGENGC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e