summaryrefslogtreecommitdiff
path: root/storage/innobase/include/buf0buddy.h
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2010-04-19 20:53:16 +0300
committerVasil Dimov <vasil.dimov@oracle.com>2010-04-19 20:53:16 +0300
commitc7525a01306e49897c52ea7e9844697f8f8379a1 (patch)
tree0c1af6979d3c01e38c801d71a2fc74150cc30667 /storage/innobase/include/buf0buddy.h
parent49dc3a7b325135c8cd2f93c213a48497d1b57dae (diff)
parented30b504d2fd9c14af243248f5a94ae5488ad026 (diff)
downloadmariadb-git-c7525a01306e49897c52ea7e9844697f8f8379a1.tar.gz
Merge from innodb-branches-innodb+ (2)
Diffstat (limited to 'storage/innobase/include/buf0buddy.h')
-rw-r--r--storage/innobase/include/buf0buddy.h29
1 files changed, 8 insertions, 21 deletions
diff --git a/storage/innobase/include/buf0buddy.h b/storage/innobase/include/buf0buddy.h
index 7648950d5d1..03588d18197 100644
--- a/storage/innobase/include/buf0buddy.h
+++ b/storage/innobase/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 */
__attribute__((malloc));
@@ -61,28 +63,13 @@ 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 */
__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 + 1];
-
#ifndef UNIV_NONINL
# include "buf0buddy.ic"
#endif