Commit 9abc6fd7 authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: constexpr PFS_table_context::m_word_size

parent b59d0762
...@@ -154,7 +154,6 @@ bool PFS_table_context::initialize(void) ...@@ -154,7 +154,6 @@ bool PFS_table_context::initialize(void)
m_map= context->m_map; m_map= context->m_map;
DBUG_ASSERT(m_map_size == context->m_map_size); DBUG_ASSERT(m_map_size == context->m_map_size);
m_map_size= context->m_map_size; m_map_size= context->m_map_size;
m_word_size= context->m_word_size;
} }
} }
else else
...@@ -168,7 +167,6 @@ bool PFS_table_context::initialize(void) ...@@ -168,7 +167,6 @@ bool PFS_table_context::initialize(void)
/* Initialize a new context, store in TLS. */ /* Initialize a new context, store in TLS. */
m_last_version= m_current_version; m_last_version= m_current_version;
m_map= NULL; m_map= NULL;
m_word_size= sizeof(ulong) * 8;
/* Allocate a bitmap to record which threads are materialized. */ /* Allocate a bitmap to record which threads are materialized. */
if (m_map_size > 0) if (m_map_size > 0)
...@@ -190,7 +188,7 @@ bool PFS_table_context::initialize(void) ...@@ -190,7 +188,7 @@ bool PFS_table_context::initialize(void)
/* Constructor for global or single thread tables, map size = 0. */ /* 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) : 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_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) m_restore(restore), m_initialized(false), m_last_item(0)
{ {
initialize(); initialize();
...@@ -199,7 +197,7 @@ PFS_table_context::PFS_table_context(ulonglong current_version, bool restore, th ...@@ -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. */ /* 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) : 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_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) m_restore(restore), m_initialized(false), m_last_item(0)
{ {
initialize(); initialize();
......
...@@ -74,7 +74,7 @@ class PFS_table_context ...@@ -74,7 +74,7 @@ class PFS_table_context
ulonglong m_last_version; ulonglong m_last_version;
ulong *m_map; ulong *m_map;
ulong m_map_size; ulong m_map_size;
ulong m_word_size; static constexpr ulong m_word_size= 8 * sizeof(ulong);
bool m_restore; bool m_restore;
bool m_initialized; bool m_initialized;
ulong m_last_item; ulong m_last_item;
......
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