Commit 44f9d069 authored by marko's avatar marko

branches/zip: Define buf_block_get_frame() as a const-preserving macro.

parent 14b70068
...@@ -774,16 +774,19 @@ buf_page_set_accessed( ...@@ -774,16 +774,19 @@ buf_page_set_accessed(
/*==================*/ /*==================*/
buf_page_t* bpage, /* in/out: control block */ buf_page_t* bpage, /* in/out: control block */
ibool accessed); /* in: accessed */ ibool accessed); /* in: accessed */
#ifdef UNIV_DEBUG
/************************************************************************* /*************************************************************************
Gets a pointer to the memory frame of a block. */ Gets a pointer to the memory frame of a block. */
UNIV_INLINE UNIV_INLINE
buf_frame_t* buf_frame_t*
buf_block_get_frame( buf_block_get_frame(
/*================*/ /*================*/
/* out: pointer to the frame */ /* out: pointer to the frame */
buf_block_t* block) /* in: pointer to the control block */ const buf_block_t* block) /* in: pointer to the control block */
__attribute__((pure)); __attribute__((pure));
#else /* UNIV_DEBUG */
# define buf_block_get_frame(block) block->frame
#endif /* UNIV_DEBUG */
/************************************************************************* /*************************************************************************
Gets the space id of a block. */ Gets the space id of a block. */
UNIV_INLINE UNIV_INLINE
......
...@@ -460,17 +460,18 @@ buf_page_set_accessed( ...@@ -460,17 +460,18 @@ buf_page_set_accessed(
bpage->accessed = accessed; bpage->accessed = accessed;
} }
#ifdef UNIV_DEBUG
/************************************************************************* /*************************************************************************
Gets a pointer to the memory frame of a block. */ Gets a pointer to the memory frame of a block. */
UNIV_INLINE UNIV_INLINE
buf_frame_t* buf_frame_t*
buf_block_get_frame( buf_block_get_frame(
/*================*/ /*================*/
/* out: pointer to the frame */ /* out: pointer to the frame */
buf_block_t* block) /* in: pointer to the control block */ const buf_block_t* block) /* in: pointer to the control block */
{ {
ut_ad(block); ut_ad(block);
#ifdef UNIV_DEBUG
switch (buf_block_get_state(block)) { switch (buf_block_get_state(block)) {
case BUF_BLOCK_ZIP_FREE: case BUF_BLOCK_ZIP_FREE:
case BUF_BLOCK_ZIP_PAGE: case BUF_BLOCK_ZIP_PAGE:
...@@ -488,9 +489,9 @@ buf_block_get_frame( ...@@ -488,9 +489,9 @@ buf_block_get_frame(
} }
ut_error; ut_error;
ok: ok:
#endif /* UNIV_DEBUG */ return((buf_frame_t*) block->frame);
return(block->frame);
} }
#endif /* UNIV_DEBUG */
/************************************************************************* /*************************************************************************
Gets the space id of a block. */ Gets the space id of a block. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment