diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-01-29 13:50:26 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:22 +0100 |
commit | 7c58e97bf6f80a251046c5b3e7bce826fe058bd6 (patch) | |
tree | 7d32d26b320cf83296ee0ede2ea164ad116c4de8 /sql/hash_filo.h | |
parent | 2ac3121af2767186c489054db5d4871d04b8eef4 (diff) | |
download | mariadb-git-7c58e97bf6f80a251046c5b3e7bce826fe058bd6.tar.gz |
perfschema memory related instrumentation changes
Diffstat (limited to 'sql/hash_filo.h')
-rw-r--r-- | sql/hash_filo.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sql/hash_filo.h b/sql/hash_filo.h index d815c428ac6..864e91594b2 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -48,6 +48,7 @@ private: class hash_filo { private: + PSI_memory_key m_psi_key; const uint key_offset, key_length; const my_hash_get_key get_key; /** Size of this hash table. */ @@ -61,15 +62,13 @@ public: mysql_mutex_t lock; HASH cache; - hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg, - my_hash_get_key get_key_arg, my_hash_free_key free_element_arg, - CHARSET_INFO *hash_charset_arg) - :key_offset(key_offset_arg), key_length(key_length_arg), - get_key(get_key_arg), m_size(size_arg), - free_element(free_element_arg),init(0), - hash_charset(hash_charset_arg), - first_link(NULL), - last_link(NULL) + hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg, + uint key_length_arg, my_hash_get_key get_key_arg, + my_hash_free_key free_element_arg, CHARSET_INFO *hash_charset_arg) + : m_psi_key(psi_key), key_offset(key_offset_arg), + key_length(key_length_arg), get_key(get_key_arg), m_size(size_arg), + free_element(free_element_arg),init(0), hash_charset(hash_charset_arg), + first_link(NULL), last_link(NULL) { bzero((char*) &cache,sizeof(cache)); } @@ -96,7 +95,7 @@ public: last_link= NULL; (void) my_hash_free(&cache); (void) my_hash_init(&cache,hash_charset,m_size,key_offset, - key_length, get_key, free_element,0); + key_length, get_key, free_element, 0, m_psi_key); if (!locked) mysql_mutex_unlock(&lock); } @@ -202,10 +201,10 @@ public: template <class T> class Hash_filo: public hash_filo { public: - Hash_filo(uint size_arg, uint key_offset_arg, uint key_length_arg, - my_hash_get_key get_key_arg, my_hash_free_key free_element_arg, - CHARSET_INFO *hash_charset_arg) : - hash_filo(size_arg, key_offset_arg, key_length_arg, + Hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg, uint + key_length_arg, my_hash_get_key get_key_arg, my_hash_free_key + free_element_arg, CHARSET_INFO *hash_charset_arg) : + hash_filo(psi_key, size_arg, key_offset_arg, key_length_arg, get_key_arg, free_element_arg, hash_charset_arg) {} T* first() { return (T*)hash_filo::first(); } T* last() { return (T*)hash_filo::last(); } |