* gc.c (heap_pages_free_unused_pages): check tomb page availability

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
This commit is contained in:
ko1 2014-02-26 09:46:45 +00:00
parent a8cb9b02a0
commit 8467d86f8a
2 changed files with 25 additions and 17 deletions

View File

@ -1,3 +1,9 @@
Wed Feb 26 18:43:43 2014 Koichi Sasada <ko1@atdot.net>
* gc.c (heap_pages_free_unused_pages): check tomb page availability
at first.
And return immediately if we don't touch sorted list any more.
Wed Feb 26 14:10:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (setup_exception): preserve exception class name encoding

6
gc.c
View File

@ -999,6 +999,7 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
{
size_t i, j;
if (heap_tomb->pages) {
for (i = j = 1; j < heap_pages_used; i++) {
struct heap_page *page = heap_pages_sorted[i];
@ -1011,8 +1012,8 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
heap_page_free(objspace, page);
continue;
}
else {
/* fprintf(stderr, "heap_pages_free_unused_pages: remain!!\n"); */
else if (i == j) {
return; /* no need to check rest pages */
}
}
if (i != j) {
@ -1021,6 +1022,7 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
j++;
}
assert(j == heap_pages_used);
}
}
static struct heap_page *