drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
buf0buddy.h File Reference
#include "univ.i"
#include "buf0types.h"
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.

Functions

UNIV_INLINE void * buf_buddy_alloc (buf_pool_t *buf_pool, ulint size, ibool *lru) __attribute__((malloc))
UNIV_INLINE void buf_buddy_free (buf_pool_t *buf_pool, void *buf, ulint size) __attribute__((nonnull))

Detailed Description

Binary buddy allocator for compressed pages

Created December 2006 by Marko Makela

Definition in file buf0buddy.h.

Macro Definition Documentation

◆ buf0buddy_h

#define buf0buddy_h

Definition at line 28 of file buf0buddy.h.

Function Documentation

◆ buf_buddy_alloc()

UNIV_INLINE void * 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 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.

Returns
allocated block, possibly NULL if lru == NULL
Parameters
buf_poolbuffer pool in which the block resides
sizein: block size, up to 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, or NULL if the LRU list should not be used

◆ buf_buddy_free()

UNIV_INLINE void buf_buddy_free ( buf_pool_t * buf_pool,
void * buf,
ulint size )

Release a block.

Parameters
buf_poolbuffer 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