diff options
Diffstat (limited to 'storage/xtradb/include/buf0buddy.h')
-rw-r--r-- | storage/xtradb/include/buf0buddy.h | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/storage/xtradb/include/buf0buddy.h b/storage/xtradb/include/buf0buddy.h index 3a35f8e46e9..f51b8020918 100644 --- a/storage/xtradb/include/buf0buddy.h +++ b/storage/xtradb/include/buf0buddy.h @@ -36,22 +36,24 @@ Created December 2006 by Marko Makela /**********************************************************************//** Allocate a block. The thread calling this function must hold -buf_pool_mutex and must not hold buf_pool_zip_mutex or any -block->mutex. The buf_pool_mutex may only be released and reacquired +buf_pool->mutex and must not hold buf_pool->zip_mutex or any +block->mutex. The buf_pool->mutex may only be released and reacquired if lru != NULL. This function should only be used for allocating compressed page frames or control blocks (buf_page_t). Allocated control blocks must be properly initialized immediately after buf_buddy_alloc() has returned the memory, before releasing -buf_pool_mutex. +buf_pool->mutex. @return allocated block, possibly NULL if lru == NULL */ UNIV_INLINE void* buf_buddy_alloc( /*============*/ + buf_pool_t* buf_pool, + /*!< buffer pool in which the block resides */ ulint size, /*!< in: block size, up to UNIV_PAGE_SIZE */ ibool* lru, /*!< in: pointer to a variable that will be assigned TRUE if storage was allocated from the LRU list - and buf_pool_mutex was temporarily released, + and buf_pool->mutex was temporarily released, or NULL if the LRU list should not be used */ ibool have_page_hash_mutex) __attribute__((malloc)); @@ -62,29 +64,14 @@ UNIV_INLINE void buf_buddy_free( /*===========*/ + buf_pool_t* buf_pool, + /*!< buffer pool in which the block resides */ void* buf, /*!< in: block to be freed, must not be pointed to by the buffer pool */ ulint size, /*!< in: block size, up to UNIV_PAGE_SIZE */ ibool have_page_hash_mutex) __attribute__((nonnull)); -/** Statistics of buddy blocks of a given size. */ -struct buf_buddy_stat_struct { - /** Number of blocks allocated from the buddy system. */ - ulint used; - /** Number of blocks relocated by the buddy system. */ - ib_uint64_t relocated; - /** Total duration of block relocations, in microseconds. */ - ib_uint64_t relocated_usec; -}; - -/** Statistics of buddy blocks of a given size. */ -typedef struct buf_buddy_stat_struct buf_buddy_stat_t; - -/** Statistics of the buddy system, indexed by block size. -Protected by buf_pool_mutex. */ -extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1]; - #ifndef UNIV_NONINL # include "buf0buddy.ic" #endif |