1
/*****************************************************************************
3
Copyright (C) 2006, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/buf0buddy.h
21
Binary buddy allocator for compressed pages
23
Created December 2006 by Marko Makela
24
*******************************************************/
30
#ifdef UNIV_MATERIALIZE
36
#include "buf0types.h"
38
/**********************************************************************//**
39
Allocate a block. The thread calling this function must hold
40
buf_pool->mutex and must not hold buf_pool->zip_mutex or any
41
block->mutex. The buf_pool->mutex may only be released and reacquired
42
if lru != NULL. This function should only be used for allocating
43
compressed page frames or control blocks (buf_page_t). Allocated
44
control blocks must be properly initialized immediately after
45
buf_buddy_alloc() has returned the memory, before releasing
47
@return allocated block, possibly NULL if lru == NULL */
53
/*!< buffer pool in which the block resides */
54
ulint size, /*!< in: block size, up to UNIV_PAGE_SIZE */
55
ibool* lru) /*!< in: pointer to a variable that will be assigned
56
TRUE if storage was allocated from the LRU list
57
and buf_pool->mutex was temporarily released,
58
or NULL if the LRU list should not be used */
59
__attribute__((malloc));
61
/**********************************************************************//**
68
/*!< buffer pool in which the block resides */
69
void* buf, /*!< in: block to be freed, must not be
70
pointed to by the buffer pool */
71
ulint size) /*!< in: block size, up to UNIV_PAGE_SIZE */
72
__attribute__((nonnull));
75
# include "buf0buddy.ic"
78
#endif /* buf0buddy_h */