Cleanup: constexpr PFS_table_context::m_word_size

This commit is contained in:
Marko Mäkelä 2021-04-21 12:44:23 +03:00
parent b59d07624c
commit 9abc6fd73f
2 changed files with 3 additions and 5 deletions

View file

@ -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();

View file

@ -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;