diff --git a/include/buf0buddy.ic b/include/buf0buddy.ic index 44cb8b4fbb7..57f3e3b3aae 100644 --- a/include/buf0buddy.ic +++ b/include/buf0buddy.ic @@ -39,7 +39,7 @@ buf_buddy_get_offset( { ut_ad(ut_is_2pow(size)); ut_ad(size >= BUF_BUDDY_LOW); - ut_ad(size < BUF_BUDDY_LOW << BUF_BUDDY_SIZES); + ut_ad(size < BUF_BUDDY_HIGH); if (((ulint) page) & size) { return(-(lint) size); diff --git a/include/buf0buf.h b/include/buf0buf.h index e676b866228..437fa309dd6 100644 --- a/include/buf0buf.h +++ b/include/buf0buf.h @@ -1171,8 +1171,8 @@ struct buf_pool_struct{ /* unmodified compressed pages */ UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES]; /* buddy free lists */ -#if BUF_BUDDY_LOW << BUF_BUDDY_SIZES != UNIV_PAGE_SIZE -# error "BUF_BUDDY_LOW << BUF_BUDDY_SIZES != UNIV_PAGE_SIZE" +#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE +# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE" #endif #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE" diff --git a/include/buf0types.h b/include/buf0types.h index 83ed19e4a11..617e5e53cea 100644 --- a/include/buf0types.h +++ b/include/buf0types.h @@ -43,5 +43,10 @@ enum buf_io_fix { # define BUF_BUDDY_SIZES 7 #endif +/* twice the maximum block size of the buddy system; +the underlying memory is aligned by this amount: +this must be equal to UNIV_PAGE_SIZE */ +#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES) + #endif