#include <buf0block_hint.h>
|
void | store (buf_block_t *block) |
| Stores the pointer to the block, which is currently buffer-fixed. More...
|
|
void | clear () |
| Clears currently stored pointer. More...
|
|
template<typename F > |
auto | run_with_hint (F &&f) |
| Executes given function with the block pointer which was previously stored or with nullptr if the pointer is no longer valid, was cleared or not stored. More...
|
|
|
void | buffer_fix_block_if_still_valid () |
| A helper function which checks if m_block is not a dangling pointer and still points to block with page with m_page_id and if so, buffer-fixes it, otherwise clear()s it. More...
|
|
◆ buffer_fix_block_if_still_valid()
void buf::Block_hint::buffer_fix_block_if_still_valid |
( |
| ) |
|
|
private |
A helper function which checks if m_block is not a dangling pointer and still points to block with page with m_page_id and if so, buffer-fixes it, otherwise clear()s it.
◆ buffer_unfix_block_if_needed()
void buf::Block_hint::buffer_unfix_block_if_needed |
( |
buf_block_t * |
block | ) |
|
|
staticprivate |
A helper function which decrements block->buf_fix_count if it's non-null.
- Parameters
-
[in] | block | A pointer to a block or nullptr |
◆ clear()
void buf::Block_hint::clear |
( |
| ) |
|
Clears currently stored pointer.
◆ run_with_hint()
template<typename F >
auto buf::Block_hint::run_with_hint |
( |
F && |
f | ) |
|
|
inline |
Executes given function with the block pointer which was previously stored or with nullptr if the pointer is no longer valid, was cleared or not stored.
- Parameters
-
[in] | f | The function to be executed. It will be passed the pointer. If you wish to use the block pointer subsequently, you need to ensure you buffer-fix it before returning from f. |
- Returns
- the return value of f
◆ store()
Stores the pointer to the block, which is currently buffer-fixed.
- Parameters
-
[in] | block | a pointer to a buffer-fixed block to be stored |
◆ m_block
The block pointer stored by store().
◆ m_page_id
If m_block is non-null, the m_block->page.id at time it was stored.
The documentation for this class was generated from the following files: