Put structure check fields behind SS_DEBUG macros. Thus, they are only included in debug builds.

This commit is contained in:
vraatikka
2013-09-09 10:05:46 +03:00
parent 27338c2537
commit e1d7a5640d
6 changed files with 18 additions and 3 deletions

View File

@ -68,7 +68,9 @@ typedef void *(*HASHMEMORYFN)(void *);
* The general purpose hashtable struct.
*/
typedef struct hashtable {
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_top;
#endif
int hashsize; /**< The number of HASHENTRIES */
HASHENTRIES **entries; /**< The entries themselves */
int (*hashfn)(void *); /**< The hash function */
@ -78,7 +80,9 @@ typedef struct hashtable {
SPINLOCK spin; /**< Internal spinlock for the hashtable */
int n_readers; /**< Number of clients reading the table */
int writelock; /**< The table is locked by a writer */
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_tail;
#endif
} HASHTABLE;
extern HASHTABLE *hashtable_alloc(int, int (*hashfn)(), int (*cmpfn)());