mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
MDEV-17441: Pointer indirection for buf_block_t::debug_latch
This is follow-up patch. Avoid calling constructor/destructor twice.
This commit is contained in:
parent
0e11d96a84
commit
db9b96ef02
1 changed files with 2 additions and 4 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
/********************************************************************//**
|
||||
|
|
Loading…
Add table
Reference in a new issue