aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--gc.c14
2 files changed, 9 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 4267ad771f..d0c0e39352 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 29 16:24:52 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (heap_page_resurrect): return a page in tomb heap even if
+ freelist is NULL.
+
Tue Oct 29 15:46:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
diff --git a/gc.c b/gc.c
index a570ae3810..f3f6d62c4b 100644
--- a/gc.c
+++ b/gc.c
@@ -936,17 +936,11 @@ heap_page_resurrect(rb_objspace_t *objspace)
{
struct heap_page *page;
- if (heap_tomb->pages) {
- page = heap_tomb->pages;
- while (page) {
- if (page->freelist) {
- heap_unlink_page(objspace, heap_tomb, page);
- return page;
- }
- page = page->next;
- }
+ if ((page = heap_tomb->pages) != NULL) {
+ heap_unlink_page(objspace, heap_tomb, page);
+ return page;
}
- return 0;
+ return NULL;
}
static struct heap_page *