summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-12-28 13:22:44 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-12-28 13:24:10 +0400
commitdb9b96ef02cb6a44049ca4a1251915f6f51de108 (patch)
treee02bd8e98a27dabb723e4cf55049874fad829cde
parent0e11d96a84f1545f238fa92a7e44c2a7398ac304 (diff)
downloadmariadb-git-db9b96ef02cb6a44049ca4a1251915f6f51de108.tar.gz
MDEV-17441: Pointer indirection for buf_block_t::debug_latch
This is follow-up patch. Avoid calling constructor/destructor twice.
-rw-r--r--storage/innobase/buf/buf0buf.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 8d8e953686b..bc52f53e604 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1458,7 +1458,7 @@ buf_block_init(
page_zip_des_init(&block->page.zip);
mutex_create(LATCH_ID_BUF_BLOCK_MUTEX, &block->mutex);
- ut_d(block->debug_latch = UT_NEW_NOKEY(rw_lock_t()));
+ ut_d(block->debug_latch = (rw_lock_t *) ut_malloc_nokey(sizeof(rw_lock_t)));
#if defined PFS_SKIP_BUFFER_MUTEX_RWLOCK || defined PFS_GROUP_BUFFER_SYNC
/* If PFS_SKIP_BUFFER_MUTEX_RWLOCK is defined, skip registration
@@ -1744,9 +1744,7 @@ static void buf_block_free_mutexes(buf_block_t* block)
mutex_free(&block->mutex);
rw_lock_free(&block->lock);
ut_d(rw_lock_free(block->debug_latch));
- ut_ad(!block->debug_latch->magic_n);
- ut_d(block->debug_latch->magic_n = RW_LOCK_MAGIC_N);
- ut_d(UT_DELETE(block->debug_latch));
+ ut_d(ut_free(block->debug_latch));
}
/********************************************************************//**