summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2013-06-19* include/ruby/ruby.h (struct rb_data_type_struct), gc.c: addko1
rb_data_type_struct::flags. Now, this flags is passed at T_DATA object creation. You can specify FL_WB_PROTECTED on this flag. * iseq.c: making non-shady iseq objects. * class.c, compile.c, proc.c, vm.c: add WB for iseq objects. * vm_core.h, iseq.h: constify fields to detect WB insertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19gc.c: more infonobu
* gc.c (gc_mark_children): show more info for broken object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (garbage_collect_body): use FIX2INT for ruby_gc_stress.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (rb_objspace::gc_stress): int -> VALUE to store Fixnum object.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (make_deferred): clear flags to T_ZOMBIE.ko1
* gc.c (slot_sweep_body): fix indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (rgengc_remember): fix output level.ko1
* gc.c (rgengc_rememberset_mark): fix to output clear count. (shady_object_count + clear_count = count of remembered objects) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (rgengc_remember): check T_NONE and T_ZOMBIEko1
if RGENGC_CHECK_MODE > 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (RGENGC_CHECK_MODE): add new check mode `3'.ko1
In this mode, show all references if there is a miss-corrected object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (gc_stress_set): add special option of GC.stress.ko1
`GC.stress=(flag)' accepts integer to control behavior of GC. See code for details. Of course, this feature is only for MRI. You can debug RGenGC (WB) using `GC.stress = 1'. Using this option, do minor marking at all possible places. GC::STRESS_MINOR_MARK = 1 and GC::STRESS_LAZY_SWEEP = 2 seem good to add. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18 * gc.c (gc_profile_record_flag): reason seems like one-hot encoding.tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c: Rename rb_mObSpace -> rb_mObjSpacezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (gc_stat): add `generated_normal_object_count_types' forko1
RGENGC_PROFILE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* gc.c (gc_mark_maybe): check to skip T_NONE.ko1
* gc.c (markable_object_p): do not need to check (flags == 0) here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* gc.c (gc_mark_children): don't need to care about T_ZOMBIE here.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* gc.c (ObjectSpace): is a module not a class.eregon
* ext/objspace/objspace.c: try to include overview in rdoc, see #8537. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* gc.c: fix example of ObjectSpace.define_finalizer in overvieweregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* gc.c (gc_mark_maybe): added. check `is_pointer_to_heap()' andko1
type is not T_ZOMBE. * gc.c: use `gc_mark_maybe()'. T_ZOMBIE objects should not be pushed to the mark stack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 * gc.c: Fixup around GC by MALLOC. tarui
Add allocate size to malloc_increase before GC for updating limit in after_gc_sweep. Reset malloc_increase into garbage_collect() for preventing GC again soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 * gc.c : add some colums to more detail profile.tarui
new colums: Allocated size, Prepare Time, Removing Objects, Empty Objects git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 * gc.c (gc_prof_timer_stop): Merge function codes of GC_PROFILE_MORE_DETAIL ↵tarui
and !GC_PROFILE_MORE_DETAIL. * gc.c (gc_prof_mark_timer_start): Ditto. * gc.c (gc_prof_mark_timer_stop): Ditto. * gc.c (gc_prof_sweep_slot_timer_start): Ditto. * gc.c (gc_prof_sweep_slot_timer_stop): Ditto. * gc.c (gc_prof_set_malloc_info): Ditto. * gc.c (gc_prof_set_heap_info): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10* gc.c (rgengc_remember): permit promoted object.ko1
(rb_gc_writebarrier -> remember) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10* gc.c (RVALUE_PROMOTE): fix parameter name (`x' to `obj')ko1
and make it inline function (like RVALUE_PROMOTE). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10* gc.c (wmap_mark): check allocation of `w->obj2wmap'.ko1
(no-allocation `w->obj2wmap' will be NULL pointer reference) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* gc.c (before_gc_sweep): noinline can also avoid the segv instead ofnaruse
-O0 of r41084. this way is expected less slow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* gc.c (gc_clear_slot_bits): used only if no RGenGC.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 * gc.c: use oldgen bitmap as initial mark bitmap when mijor gc.tarui
so can skip oldgen bitmap check around mark & sweep. * gc.c (slot_sweep_body): change scan algorithm for performance: from object's pointer base to bitmap one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 * gc.c: introduce oldgen bitmap for preparing performance tuning.tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 * gc.c (MARKED_IN_BITMAP, MARK_IN_BITMAP, CLEAR_IN_BITMAP): bringtarui
bitmap macros in one place, and introduce BITMAP_BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* gc.c: remove "Sunny" terminology.ko1
"Sunny" doesn't mean antonym of "Shady" (questionable, doubtful, etc). Instead of "Suuny", use "non-shady" or "normal". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 * gc.c (gc_mark): get rid of pushing useless objests.tarui
* gc.c (rgengc_rememberset_mark): bypass gc_mark() in order to push sunny old object at minor gc. * gc.c (gc_mark_children): move sunny old check to gc_mark(). * gc.c (rgengc_check_shady): remove DEMOTE that already unnecessary. * gc.c (rb_gc_writebarrier): ditto. change sunny old check point in order to save mark stack and remove unnatural rest_sweep & demote. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 * gc.c (rgengc_rememberset_mark): change scan algorithm for performance:tarui
from object's pointer base to bitmap one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05use attribute is more simple way for r41083naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05* gc.c (before_gc_sweep): don't optimize it to avoid segv on Ubuntunaruse
10.04 gcc 4.4. http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20130527T190301Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-29* gc.c (gc_profile_enable): rest_sweep() to finish last GC.ko1
Profiling record is allocated at first of marking phase. Enable at lazy sweeping may cause an error (SEGV). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* gc.c (gc_stat): remove wrong rest_sweep().ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* gc.c (garbage_collect_body): fix GC_ENABLE_LAZY_SWEEP condition.ko1
* gc.c (GC_NOTIFY): move debug print location and use stderr instead of stdout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* include/ruby/ruby.h, gc.c: add new internal eventko1
RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of after_sweep(). Time chart with lazy sweep is here: (1) Kick RUBY_INTERNAL_EVENT_GC_START (2) [gc_marks()] (3) [lazy_sweep()] (4) [... run Ruby program (mutator) with lazy_sweep() ...] (5) [after_sweep()] (6) Kick RUBY_INTERNAL_EVENT_GC_END (7) [... run Ruby program (mutator), and go to (1) ...] * ext/-test-/tracepoint/tracepoint.c, test/-ext-/tracepoint/test_tracepoint.rb: modify a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE toko1
RUBY_INTERNAL_EVENT_FREEOBJ. * ext/-test-/tracepoint/tracepoint.c, ext/objspace/object_tracing.c, gc.c, vm_trace.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.ko1
Read the following test to know HOWTO. This feature is a sample of RUBY_INTERNAL_EVENT. * test/objspace/test_objspace.rb: add a test. * ext/objspace/object_tracing.c: ditto. * gc.c (rb_gc_count): add. THis function returns GC count. * internal.h: add decl. of rb_gc_count(). Same as `GC.count'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.ko1
* RUBY_INTERNAL_EVENT_NEWOBJ: object created. * RUBY_INTERNAL_EVENT_FREE: object freeed. * RUBY_INTERNAL_EVENT_GC_START: GC started. And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'. Internal events can not invoke any Ruby program because the tracing timing may be critical (under huge restriction). These events can be hooked only by C-extensions. We recommend to use rb_potponed_job_register() API to call Ruby program safely. This change is mostly written by Aman Gupta (tmm1). https://bugs.ruby-lang.org/issues/8107#note-12 [Feature #8107] * include/ruby/debug.h, vm_trace.c: added two new APIs. * rb_tracearg_event_flag() returns rb_event_flag_t of this event. * rb_tracearg_object() returns created/freeed object. * ext/-test-/tracepoint/extconf.rb, ext/-test-/tracepoint/tracepoint.c, test/-ext-/tracepoint/test_tracepoint.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.ko1
Postponed jobs are registered with this API. Registered jobs are invoked at `ruby-running-safe-point' as soon as possible. This timing is completely same as finalizer timing. There are two APIs: * rb_postponed_job_register(flags, func, data): register a postponed job with data. flags are reserved. * rb_postponed_job_register_one(flags, func, data): same as `rb_postponed_job_register', but only one `func' job is registered (skip if `func' is already registered). This change is mostly written by Aman Gupta (tmm1). https://bugs.ruby-lang.org/issues/8107#note-15 [Feature #8107] * gc.c: use postponed job API for finalizer. * common.mk: add dependency from vm_trace.c to debug.h. * ext/-test-/postponed_job/extconf.rb, postponed_job.c, test/-ext-/postponed_job/test_postponed_job.rb: add a test. * thread.c: implement postponed API. * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* gc.c (gc_stat): collect promote_operation_count andko1
types (RGENGC_PROFILE >= 2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* gc.c (gc_stat): collect shade_operation_count,ko1
remembered_sunny_object_count and remembered_shady_object_count for each types when RGENGC_PROFILE >= 2. They are informative for optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26* hash.c (rb_hash_tbl_raw), internal.h: added.ko1
Returns st_table without shading hash. * array.c: use rb_hash_tbl_raw() for read-only purpose. * compile.c (iseq_compile_each): ditto. * gc.c (count_objects): ditto. * insns.def: ditto. * process.c: ditto. * thread.c (clear_coverage): ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e