InnoDB Plugin  1.0
buf0buddy.h File Reference
#include "univ.i"
#include "buf0types.h"
#include "buf0buddy.ic"
Include dependency graph for buf0buddy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


UNIV_INLINE byte * buf_buddy_alloc (buf_pool_t *buf_pool, ulint size, ibool *lru))
UNIV_INLINE void buf_buddy_free (buf_pool_t *buf_pool, void *buf, ulint size))

Detailed Description

Binary buddy allocator for compressed pages

Created December 2006 by Marko Makela

Function Documentation

UNIV_INLINE byte* buf_buddy_alloc ( buf_pool_t buf_pool,
ulint  size,
ibool lru 

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 be released and reacquired. This function should only be used for allocating compressed page frames.

allocated block, never NULL
buf_poolin/out: buffer pool in which the page resides
sizein: compressed page size (between UNIV_ZIP_SIZE_MIN and UNIV_PAGE_SIZE)
lruin: pointer to a variable that will be assigned TRUE if storage was allocated from the LRU list and buf_pool->mutex was temporarily released
UNIV_INLINE void buf_buddy_free ( buf_pool_t buf_pool,
void *  buf,
ulint  size 

Deallocate a block.

buf_poolin/out: buffer pool in which the block resides
bufin: block to be freed, must not be pointed to by the buffer pool
sizein: block size, up to UNIV_PAGE_SIZE