зеркало из https://github.com/github/ruby.git
* gc.c: change objspace::rgengc::parent_object_is_old (boolean)
to objspace::rgengc::parent_object (VALUE). Use Qfalse or RVALUE pointer instead of FALSE and TRUE. * gc.c (gc_marks_body): should clear parent_object just before gc_mark_roots() because there are no parents objects for root objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
61a2893457
Коммит
41929aa6b6
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Fri Jul 25 14:07:27 2014 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c: change objspace::rgengc::parent_object_is_old (boolean)
|
||||
to objspace::rgengc::parent_object (VALUE).
|
||||
Use Qfalse or RVALUE pointer instead of FALSE and TRUE.
|
||||
|
||||
* gc.c (gc_marks_body): should clear parent_object just before
|
||||
gc_mark_roots() because there are no parents objects
|
||||
for root objects.
|
||||
|
||||
Fri Jul 25 13:45:39 2014 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (rb_gc_writebarrier_remember_promoted): should remember only
|
||||
|
|
18
gc.c
18
gc.c
|
@ -526,13 +526,10 @@ typedef struct rb_objspace {
|
|||
|
||||
#if USE_RGENGC
|
||||
struct {
|
||||
VALUE parent_object;
|
||||
int during_minor_gc;
|
||||
int parent_object_is_old;
|
||||
|
||||
int need_major_gc;
|
||||
|
||||
size_t last_major_gc;
|
||||
|
||||
size_t remembered_shady_object_count;
|
||||
size_t remembered_shady_object_limit;
|
||||
size_t old_object_count;
|
||||
|
@ -3667,7 +3664,7 @@ static void
|
|||
rgengc_check_relation(rb_objspace_t *objspace, VALUE obj)
|
||||
{
|
||||
#if USE_RGENGC
|
||||
if (objspace->rgengc.parent_object_is_old) {
|
||||
if (objspace->rgengc.parent_object) {
|
||||
if (!RVALUE_WB_PROTECTED(obj)) {
|
||||
if (rgengc_remember(objspace, obj)) {
|
||||
objspace->rgengc.remembered_shady_object_count++;
|
||||
|
@ -3784,14 +3781,14 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
|
|||
/* infant -> young */
|
||||
RVALUE_PROMOTE_INFANT(objspace, (VALUE)obj, TRUE);
|
||||
#if RGENGC_AGE2_PROMOTION
|
||||
objspace->rgengc.parent_object_is_old = FALSE;
|
||||
objspace->rgengc.parent_object = Qfalse;
|
||||
#else
|
||||
objspace->rgengc.parent_object_is_old = TRUE;
|
||||
objspace->rgengc.parent_object = (VALUE)obj;
|
||||
#endif
|
||||
rgengc_report(3, objspace, "gc_mark_children: promote infant -> young %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
|
||||
}
|
||||
else {
|
||||
objspace->rgengc.parent_object_is_old = TRUE;
|
||||
objspace->rgengc.parent_object = (VALUE)obj;
|
||||
|
||||
#if RGENGC_AGE2_PROMOTION
|
||||
if (RVALUE_YOUNG_P((VALUE)obj)) {
|
||||
|
@ -3812,7 +3809,7 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
|
|||
}
|
||||
else {
|
||||
rgengc_report(3, objspace, "gc_mark_children: do not promote non-WB-protected %p (%s).\n", (void *)obj, obj_type_name((VALUE)obj));
|
||||
objspace->rgengc.parent_object_is_old = FALSE;
|
||||
objspace->rgengc.parent_object = Qfalse;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4263,7 +4260,6 @@ gc_marks_body(rb_objspace_t *objspace, int full_mark)
|
|||
rgengc_report(1, objspace, "gc_marks_body: start (%s)\n", full_mark ? "full" : "minor");
|
||||
|
||||
#if USE_RGENGC
|
||||
objspace->rgengc.parent_object_is_old = FALSE;
|
||||
objspace->rgengc.during_minor_gc = full_mark ? FALSE : TRUE;
|
||||
|
||||
#if RGENGC_AGE2_PROMOTION
|
||||
|
@ -4281,6 +4277,8 @@ gc_marks_body(rb_objspace_t *objspace, int full_mark)
|
|||
objspace->rgengc.last_major_gc = objspace->profile.count;
|
||||
rgengc_mark_and_rememberset_clear(objspace, heap_eden);
|
||||
}
|
||||
|
||||
objspace->rgengc.parent_object = Qfalse; /* should clear just before gc_mark_roots() */
|
||||
#endif
|
||||
|
||||
gc_mark_roots(objspace, full_mark, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче