mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
branches/zip: buf_buddy_free_low(): Examine the state bits inside the
block before traversing the free list.
This commit is contained in:
parent
2eb7e547c3
commit
0a70979184
1 changed files with 10 additions and 0 deletions
|
@ -413,6 +413,15 @@ recombine:
|
|||
|
||||
buddy = (buf_page_t*) buf_buddy_get(((byte*) buf), BUF_BUDDY_LOW << i);
|
||||
|
||||
if (buddy->state != BUF_BLOCK_ZIP_FREE) {
|
||||
|
||||
goto buddy_nonfree;
|
||||
}
|
||||
|
||||
/* The field buddy->state can only be trusted for free blocks.
|
||||
If buddy->state == BUF_BLOCK_ZIP_FREE, the block is free if
|
||||
it is in the free list. */
|
||||
|
||||
for (bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
|
||||
bpage; bpage = UT_LIST_GET_NEXT(list, bpage)) {
|
||||
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
|
||||
|
@ -436,6 +445,7 @@ buddy_free:
|
|||
ut_a(bpage != buf);
|
||||
}
|
||||
|
||||
buddy_nonfree:
|
||||
/* The buddy is not free. Is there a free block of this size? */
|
||||
bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue