From 9abc6fd73ff57c44c04bd5b18f9d1d99ddbce873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 21 Apr 2021 12:44:23 +0300 Subject: Cleanup: constexpr PFS_table_context::m_word_size --- storage/perfschema/pfs_engine_table.cc | 6 ++---- storage/perfschema/pfs_engine_table.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'storage/perfschema') diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 20df5f31dc4..22ed3132c6b 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -154,7 +154,6 @@ bool PFS_table_context::initialize(void) m_map= context->m_map; DBUG_ASSERT(m_map_size == context->m_map_size); m_map_size= context->m_map_size; - m_word_size= context->m_word_size; } } else @@ -168,7 +167,6 @@ bool PFS_table_context::initialize(void) /* Initialize a new context, store in TLS. */ m_last_version= m_current_version; m_map= NULL; - m_word_size= sizeof(ulong) * 8; /* Allocate a bitmap to record which threads are materialized. */ if (m_map_size > 0) @@ -190,7 +188,7 @@ bool PFS_table_context::initialize(void) /* Constructor for global or single thread tables, map size = 0. */ PFS_table_context::PFS_table_context(ulonglong current_version, bool restore, thread_local_key_t key) : m_thr_key(key), m_current_version(current_version), m_last_version(0), - m_map(NULL), m_map_size(0), m_word_size(sizeof(ulong)), + m_map(NULL), m_map_size(0), m_restore(restore), m_initialized(false), m_last_item(0) { initialize(); @@ -199,7 +197,7 @@ PFS_table_context::PFS_table_context(ulonglong current_version, bool restore, th /* Constructor for by-thread or aggregate tables, map size = max thread/user/host/account. */ PFS_table_context::PFS_table_context(ulonglong current_version, ulong map_size, bool restore, thread_local_key_t key) : m_thr_key(key), m_current_version(current_version), m_last_version(0), - m_map(NULL), m_map_size(map_size), m_word_size(sizeof(ulong)), + m_map(NULL), m_map_size(map_size), m_restore(restore), m_initialized(false), m_last_item(0) { initialize(); diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h index 89b723b08d7..883ff07c36c 100644 --- a/storage/perfschema/pfs_engine_table.h +++ b/storage/perfschema/pfs_engine_table.h @@ -74,7 +74,7 @@ private: ulonglong m_last_version; ulong *m_map; ulong m_map_size; - ulong m_word_size; + static constexpr ulong m_word_size= 8 * sizeof(ulong); bool m_restore; bool m_initialized; ulong m_last_item; -- cgit v1.2.1