* gc.c (gc_sweep): profile sweep time correctly when LAZY_SWEEP is
disabled. * gc.c (gc_marks_test): store oldgen count and shady count before test marking and restore them after marking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e8fc182e3
commit
ab084f4063
@ -1,3 +1,11 @@
|
|||||||
|
Fri Jun 21 15:26:45 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* gc.c (gc_sweep): profile sweep time correctly when LAZY_SWEEP is
|
||||||
|
disabled.
|
||||||
|
|
||||||
|
* gc.c (gc_marks_test): store oldgen count and shady count
|
||||||
|
before test marking and restore them after marking.
|
||||||
|
|
||||||
Fri Jun 21 15:07:42 2013 Koichi Sasada <ko1@atdot.net>
|
Fri Jun 21 15:07:42 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c: enable lazy sweep (commit miss).
|
* gc.c: enable lazy sweep (commit miss).
|
||||||
|
13
gc.c
13
gc.c
@ -2420,6 +2420,7 @@ gc_sweep(rb_objspace_t *objspace, int immediate_sweep)
|
|||||||
{
|
{
|
||||||
if (immediate_sweep) {
|
if (immediate_sweep) {
|
||||||
struct heaps_slot *next;
|
struct heaps_slot *next;
|
||||||
|
gc_prof_sweep_timer_start(objspace);
|
||||||
before_gc_sweep(objspace);
|
before_gc_sweep(objspace);
|
||||||
|
|
||||||
while (objspace->heap.sweep_slots) {
|
while (objspace->heap.sweep_slots) {
|
||||||
@ -2429,6 +2430,7 @@ gc_sweep(rb_objspace_t *objspace, int immediate_sweep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
after_gc_sweep(objspace);
|
after_gc_sweep(objspace);
|
||||||
|
gc_prof_sweep_timer_stop(objspace);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
before_gc_sweep(objspace);
|
before_gc_sweep(objspace);
|
||||||
@ -3553,12 +3555,19 @@ gc_marks_test(rb_objspace_t *objspace, bits_t *before_stored_bitmaps)
|
|||||||
{
|
{
|
||||||
bits_t *stored_bitmaps = gc_store_bitmaps(objspace);
|
bits_t *stored_bitmaps = gc_store_bitmaps(objspace);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
size_t stored_oldgen, stored_shady;
|
||||||
|
|
||||||
rgengc_report(1, objspace, "gc_marks_test: test-full-gc\n");
|
rgengc_report(1, objspace, "gc_marks_test: test-full-gc\n");
|
||||||
|
|
||||||
/* run major (full) gc with temporary mark/rememberset */
|
/* run major (full) gc with temporary mark/rememberset */
|
||||||
gc_marks_body(objspace, FALSE);
|
stored_oldgen = objspace->rgengc.oldgen_object_count;
|
||||||
|
stored_shady = objspace->rgengc.remembered_shady_object_count;
|
||||||
|
{
|
||||||
|
gc_marks_body(objspace, FALSE);
|
||||||
|
}
|
||||||
objspace->rgengc.during_minor_gc = TRUE;
|
objspace->rgengc.during_minor_gc = TRUE;
|
||||||
|
objspace->rgengc.oldgen_object_count = stored_oldgen;
|
||||||
|
objspace->rgengc.remembered_shady_object_count = stored_shady;
|
||||||
|
|
||||||
/* check */
|
/* check */
|
||||||
for (i=0; i<heaps_used; i++) {
|
for (i=0; i<heaps_used; i++) {
|
||||||
@ -5064,9 +5073,9 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
|
|||||||
if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
|
if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
|
||||||
RUBY_DTRACE_GC_SWEEP_END();
|
RUBY_DTRACE_GC_SWEEP_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objspace->profile.run) {
|
if (objspace->profile.run) {
|
||||||
double sweep_time;
|
double sweep_time;
|
||||||
|
|
||||||
gc_profile_record *record = gc_prof_record(objspace);
|
gc_profile_record *record = gc_prof_record(objspace);
|
||||||
|
|
||||||
if (record->gc_time > 0) {
|
if (record->gc_time > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user