Support freeing the lowest memory address page
This should help fix the following flaky test: ``` 1) Failure: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2751]: <0> expected but was <1>. ```
This commit is contained in:
parent
6408da70b0
commit
6778d2c582
Notes:
git
2023-09-06 12:43:34 +00:00
7
gc.c
7
gc.c
@ -2058,7 +2058,7 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (has_pages_in_tomb_heap) {
|
if (has_pages_in_tomb_heap) {
|
||||||
for (i = j = 1; j < heap_allocated_pages; i++) {
|
for (i = j = 0; j < heap_allocated_pages; i++) {
|
||||||
struct heap_page *page = heap_pages_sorted[i];
|
struct heap_page *page = heap_pages_sorted[i];
|
||||||
|
|
||||||
if (page->flags.in_tomb && page->free_slots == page->total_slots) {
|
if (page->flags.in_tomb && page->free_slots == page->total_slots) {
|
||||||
@ -2078,6 +2078,11 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
|
|||||||
GC_ASSERT(himem <= heap_pages_himem);
|
GC_ASSERT(himem <= heap_pages_himem);
|
||||||
heap_pages_himem = himem;
|
heap_pages_himem = himem;
|
||||||
|
|
||||||
|
struct heap_page *lopage = heap_pages_sorted[0];
|
||||||
|
uintptr_t lomem = (uintptr_t)lopage->start;
|
||||||
|
GC_ASSERT(lomem >= heap_pages_lomem);
|
||||||
|
heap_pages_lomem = lomem;
|
||||||
|
|
||||||
GC_ASSERT(j == heap_allocated_pages);
|
GC_ASSERT(j == heap_allocated_pages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user