Commit 17e10898 authored by marko's avatar marko

branches/zip: Make buf_block_buf_fix_inc() a macro wrapper for

buf_block_buf_fix_inc_func() to eliminate an #ifdef in every invocation.
parent 267a81eb
...@@ -1441,11 +1441,7 @@ loop: ...@@ -1441,11 +1441,7 @@ loop:
} }
} }
#ifdef UNIV_SYNC_DEBUG buf_block_buf_fix_inc(block, file, line);
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
mutex_exit(&buf_pool->mutex); mutex_exit(&buf_pool->mutex);
/* Check if this is the first access to the page */ /* Check if this is the first access to the page */
...@@ -1576,11 +1572,7 @@ buf_page_optimistic_get_func( ...@@ -1576,11 +1572,7 @@ buf_page_optimistic_get_func(
return(FALSE); return(FALSE);
} }
#ifdef UNIV_SYNC_DEBUG buf_block_buf_fix_inc(block, file, line);
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
accessed = block->accessed; accessed = block->accessed;
block->accessed = TRUE; block->accessed = TRUE;
...@@ -1708,11 +1700,8 @@ buf_page_get_known_nowait( ...@@ -1708,11 +1700,8 @@ buf_page_get_known_nowait(
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
#ifdef UNIV_SYNC_DEBUG buf_block_buf_fix_inc(block, file, line);
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
if (mode == BUF_MAKE_YOUNG) { if (mode == BUF_MAKE_YOUNG) {
...@@ -2057,11 +2046,7 @@ buf_page_create( ...@@ -2057,11 +2046,7 @@ buf_page_create(
/* The block must be put to the LRU list */ /* The block must be put to the LRU list */
buf_LRU_add_block(block, FALSE); buf_LRU_add_block(block, FALSE);
#ifdef UNIV_SYNC_DEBUG buf_block_buf_fix_inc(block, __FILE__, __LINE__);
buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__);
#else
buf_block_buf_fix_inc(block);
#endif
buf_pool->n_pages_created++; buf_pool->n_pages_created++;
mutex_exit(&(buf_pool->mutex)); mutex_exit(&(buf_pool->mutex));
......
...@@ -541,36 +541,33 @@ buf_block_get_modify_clock( ...@@ -541,36 +541,33 @@ buf_block_get_modify_clock(
return(block->modify_clock); return(block->modify_clock);
} }
#ifdef UNIV_SYNC_DEBUG
/*********************************************************************** /***********************************************************************
Increments the bufferfix count. */ Increments the bufferfix count. */
UNIV_INLINE UNIV_INLINE
void void
buf_block_buf_fix_inc_debug( buf_block_buf_fix_inc_func(
/*========================*/ /*=======================*/
buf_block_t* block, /* in: block to bufferfix */ #ifdef UNIV_SYNC_DEBUG
const char* file, /* in: file name */ const char* file, /* in: file name */
ulint line) /* in: line */ ulint line, /* in: line */
#endif /* UNIV_SYNC_DEBUG */
buf_block_t* block) /* in: block to bufferfix */
{ {
#ifdef UNIV_SYNC_DEBUG
ibool ret; ibool ret;
ret = rw_lock_s_lock_func_nowait(&(block->debug_latch), file, line); ret = rw_lock_s_lock_func_nowait(&(block->debug_latch), file, line);
ut_a(ret); ut_a(ret);
ut_a(mutex_own(&block->mutex)); ut_a(mutex_own(&block->mutex));
#endif /* UNIV_SYNC_DEBUG */
block->buf_fix_count++; block->buf_fix_count++;
} }
#ifdef UNIV_SYNC_DEBUG
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(f,l,b)
#else /* UNIV_SYNC_DEBUG */ #else /* UNIV_SYNC_DEBUG */
/*********************************************************************** # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b)
Increments the bufferfix count. */
UNIV_INLINE
void
buf_block_buf_fix_inc(
/*==================*/
buf_block_t* block) /* in: block to bufferfix */
{
block->buf_fix_count++;
}
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
/********************************************************************** /**********************************************************************
Returns the control block of a file page, NULL if not found. */ Returns the control block of a file page, NULL if not found. */
UNIV_INLINE UNIV_INLINE
......
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