diff options
author | unknown <marko@hundin.mysql.fi> | 2004-03-11 23:12:02 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-03-11 23:12:02 +0200 |
commit | edc17c009ab4d61495fd506cea58f1cf77bb06e9 (patch) | |
tree | 148175ce29b93ab6acaa2a1ca244b9b09575a98a /innobase/thr | |
parent | cb9f304897564f0eb0c76b6cd155a337fac34b19 (diff) | |
download | mariadb-git-edc17c009ab4d61495fd506cea58f1cf77bb06e9.tar.gz |
More consistent handling of magic numbers
innobase/include/data0data.h:
dtuple_struct:magic_n: Enclose in #ifdef UNIV_DEBUG
innobase/dict/dict0dict.c:
Use magic_n only #ifdef UNIV_DEBUG
innobase/dict/dict0mem.c:
Use magic_n only #ifdef UNIV_DEBUG
innobase/ha/hash0hash.c:
Remove unused functions hash_mutex_enter_all and hash_mutex_exit_all
Use magic_n only #ifdef UNIV_DEBUG
Add ut_ad(table->magic_n == HASH_TABLE_MAGIC_N)
innobase/include/dict0mem.h:
Use magic_n only #ifdef UNIV_DEBUG
innobase/include/hash0hash.h:
Remove unused functions hash_mutex_enter_all and hash_mutex_exit_all
Use magic_n only #ifdef UNIV_DEBUG
innobase/include/hash0hash.ic:
Add ut_ad(table->magic_n == HASH_TABLE_MAGIC_N)
innobase/include/mtr0mtr.h:
Use state, magic_n only #ifdef UNIV_DEBUG
innobase/include/row0ins.h:
Use magic_n only #ifdef UNIV_DEBUG
innobase/include/row0upd.h:
Use magic_n only #ifdef UNIV_DEBUG
innobase/row/row0ins.c:
Use magic_n only #ifdef UNIV_DEBUG
Add ut_ad(node->magic_n == INS_NODE_MAGIC_N)
innobase/row/row0upd.c:
Use magic_n only #ifdef UNIV_DEBUG
Add ut_ad(node->magic_n == UPD_NODE_MAGIC_N)
innobase/thr/thr0loc.c:
Use magic_n only #ifdef UNIV_DEBUG
Diffstat (limited to 'innobase/thr')
-rw-r--r-- | innobase/thr/thr0loc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c index 839cb024f25..5da1d7dfb41 100644 --- a/innobase/thr/thr0loc.c +++ b/innobase/thr/thr0loc.c @@ -46,10 +46,11 @@ struct thr_local_struct{ ibool in_ibuf;/* TRUE if the the thread is doing an ibuf operation */ hash_node_t hash; /* hash chain node */ +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define THR_LOCAL_MAGIC_N 1231234 +#endif /* UNIV_DEBUG */ +}; /*********************************************************************** Returns the local storage struct for a thread. */ @@ -167,8 +168,9 @@ thr_local_create(void) local->id = os_thread_get_curr_id(); local->handle = os_thread_get_curr(); +#ifdef UNIV_DEBUG local->magic_n = THR_LOCAL_MAGIC_N; - +#endif /* UNIV_DEBUG */ local->in_ibuf = FALSE; mutex_enter(&thr_local_mutex); @@ -207,7 +209,7 @@ thr_local_free( mutex_exit(&thr_local_mutex); - ut_a(local->magic_n == THR_LOCAL_MAGIC_N); + ut_ad(local->magic_n == THR_LOCAL_MAGIC_N); mem_free(local); } |