summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-05-13 18:26:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-13 18:46:12 +0300
commitb93ecea65cc33969cf561b941f00a7ac10d3e29a (patch)
tree895c644e7e1aeccfe04f6c186881e7d742e2cc87 /storage/innobase/include
parent26a14ee1308df65ebb9dda9a8618e64f2f2fc518 (diff)
downloadmariadb-git-b93ecea65cc33969cf561b941f00a7ac10d3e29a.tar.gz
Remove unnecessary pointer indirection for rw_lock_t
In MySQL 5.7.8 an extra level of pointer indirection was added to dict_operation_lock and some other rw_lock_t without solid justification, in mysql/mysql-server@52720f1772f9f424bf3dd62fa9c214dd608cd036. Let us revert that change and remove the rather useless rw_lock_t constructor and destructor and the magic_n field. In this way, some unnecessary pointer dereferences and heap allocation will be avoided and debugging might be a little easier.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/dict0dict.h2
-rw-r--r--storage/innobase/include/sync0rw.h22
2 files changed, 2 insertions, 22 deletions
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 4acdae31ee8..cdcdef75917 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -1676,7 +1676,7 @@ extern ib_mutex_t dict_foreign_err_mutex; /* mutex protecting the
/** the dictionary system */
extern dict_sys_t* dict_sys;
/** the data dictionary rw-latch protecting dict_sys */
-extern rw_lock_t* dict_operation_lock;
+extern rw_lock_t dict_operation_lock;
/* Dictionary system struct */
struct dict_sys_t{
diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h
index 7ced4a0e9e0..e0451d66de1 100644
--- a/storage/innobase/include/sync0rw.h
+++ b/storage/innobase/include/sync0rw.h
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2017, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -631,34 +631,14 @@ struct rw_lock_t
#endif /* UNIV_PFS_RWLOCK */
#ifdef UNIV_DEBUG
-/** Value of rw_lock_t::magic_n */
-# define RW_LOCK_MAGIC_N 22643
-
- /** Constructor */
- rw_lock_t()
- {
- magic_n = RW_LOCK_MAGIC_N;
- }
-
- /** Destructor */
- virtual ~rw_lock_t()
- {
- ut_ad(magic_n == RW_LOCK_MAGIC_N);
- magic_n = 0;
- }
-
virtual std::string to_string() const;
virtual std::string locked_from() const;
- /** For checking memory corruption. */
- ulint magic_n;
-
/** In the debug version: pointer to the debug info list of the lock */
UT_LIST_BASE_NODE_T(rw_lock_debug_t) debug_list;
/** Level in the global latching order. */
latch_level_t level;
-
#endif /* UNIV_DEBUG */
};