зеркало из https://github.com/github/ruby.git
* gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
of `during_gc' setting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
daf752b105
Коммит
5aece50163
|
@ -1,3 +1,8 @@
|
|||
Wed May 22 14:19:56 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
|
||||
of `during_gc' setting.
|
||||
|
||||
Wed May 22 07:36:08 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (garbage_collect): all GC is start from garbage_collect()
|
||||
|
|
5
gc.c
5
gc.c
|
@ -534,6 +534,7 @@ void
|
|||
rb_objspace_free(rb_objspace_t *objspace)
|
||||
{
|
||||
rest_sweep(objspace);
|
||||
|
||||
if (objspace->profile.record) {
|
||||
free(objspace->profile.record);
|
||||
objspace->profile.record = 0;
|
||||
|
@ -2275,7 +2276,6 @@ lazy_sweep(rb_objspace_t *objspace)
|
|||
if (!next) after_gc_sweep(objspace);
|
||||
|
||||
if (has_free_object) {
|
||||
during_gc = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -2286,9 +2286,11 @@ static void
|
|||
rest_sweep(rb_objspace_t *objspace)
|
||||
{
|
||||
if (objspace->heap.sweep_slots) {
|
||||
during_gc++;
|
||||
while (objspace->heap.sweep_slots) {
|
||||
lazy_sweep(objspace);
|
||||
}
|
||||
during_gc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2341,6 +2343,7 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
|
|||
|
||||
if (objspace->heap.sweep_slots) {
|
||||
if (lazy_sweep(objspace)) {
|
||||
during_gc = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче