1
1
/*****************************************************************************
3
Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
3
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
37
37
/**********************************************************************//**
38
38
Allocate a block. The thread calling this function must hold
39
39
buf_pool_mutex and must not hold buf_pool_zip_mutex or any
40
block->mutex. The buf_pool_mutex may only be released and reacquired
41
if lru != NULL. This function should only be used for allocating
42
compressed page frames or control blocks (buf_page_t). Allocated
43
control blocks must be properly initialized immediately after
44
buf_buddy_alloc() has returned the memory, before releasing
46
@return allocated block, possibly NULL if lru == NULL */
40
block->mutex. The buf_pool_mutex may be released and reacquired.
41
This function should only be used for allocating compressed page frames.
42
@return allocated block, never NULL */
51
ulint size, /*!< in: block size, up to UNIV_PAGE_SIZE */
47
ulint size, /*!< in: compressed page size
48
(between PAGE_ZIP_MIN_SIZE and UNIV_PAGE_SIZE) */
52
49
ibool* lru) /*!< in: pointer to a variable that will be assigned
53
50
TRUE if storage was allocated from the LRU list
54
and buf_pool_mutex was temporarily released,
55
or NULL if the LRU list should not be used */
56
__attribute__((malloc));
51
and buf_pool_mutex was temporarily released */
52
__attribute__((malloc, nonnull));
58
53
/**********************************************************************//**
59
54
Release a block. */