|
|
|
@ -372,7 +372,7 @@ static __always_inline bool can_merge(vm_page_t page, vm_page_t buddy)
|
|
|
|
|
/* we know that `page' is not reserved, because we
|
|
|
|
|
* check that flag before we even attempt coalition */
|
|
|
|
|
const unsigned mask = _PGA_RSVD_MASK | _PGA_ZONE_MASK;
|
|
|
|
|
merge &= (atom_read(&page->attr) & mask) == (atom_read(&page->attr) & mask);
|
|
|
|
|
merge &= (atom_read(&page->attr) & mask) == (atom_read(&buddy->attr) & mask);
|
|
|
|
|
|
|
|
|
|
return merge;
|
|
|
|
|
}
|
|
|
|
@ -398,13 +398,13 @@ void free_pages(void *ptr)
|
|
|
|
|
init_pages(ptr, PAGE_POISON_FREE, order);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int old_count = atom_sub(&page->count, 1);
|
|
|
|
|
PAGE_DEBUG_BLOCK {
|
|
|
|
|
int old_count = atom_sub(&page->count, 1);
|
|
|
|
|
if (old_count != 1) {
|
|
|
|
|
if (old_count == 0)
|
|
|
|
|
page_debug("double free of page %p", ptr);
|
|
|
|
|
page_debug("double free of %p", ptr);
|
|
|
|
|
else
|
|
|
|
|
page_debug("attempted to free page %p with references", ptr);
|
|
|
|
|
page_debug("attempted to free %p with references", ptr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|