summaryrefslogtreecommitdiff
path: root/include/asterisk/hashtab.h
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2016-08-19 19:19:28 -0400
committerCorey Farrell <git@cfware.com>2016-08-19 20:16:36 -0400
commit55ccdf93c326ecbfe6a989d45f818fbf7bbe1762 (patch)
treea2240a1eccd9e643995ae0eeba591190d181e2cc /include/asterisk/hashtab.h
parent8061d9f66f636ada714f719be9809ea58cd5c871 (diff)
Fix checks for allocation debugging.
MALLOC_DEBUG should not be used to check if debugging is actually enabled, __AST_DEBUG_MALLOC should be used instead. MALLOC_DEBUG only indicates that debugging is requested, __AST_DEBUG_MALLOC indicates it is active. Change-Id: I3ce9cdb6ec91b74ee1302941328462231be1ea53
Diffstat (limited to 'include/asterisk/hashtab.h')
-rw-r--r--include/asterisk/hashtab.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/asterisk/hashtab.h b/include/asterisk/hashtab.h
index 17eff7048..cfe035b28 100644
--- a/include/asterisk/hashtab.h
+++ b/include/asterisk/hashtab.h
@@ -251,7 +251,7 @@ unsigned int ast_hashtab_hash_short(const short num);
* \param hash a func ptr to do the hashing
* \param do_locking use locks to guarantee safety of iterators/insertion/deletion -- real simpleminded right now
*/
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
struct ast_hashtab * _ast_hashtab_create(int initial_buckets,
int (*compare)(const void *a, const void *b),
int (*resize)(struct ast_hashtab *),
@@ -294,7 +294,7 @@ void ast_hashtab_destroy( struct ast_hashtab *tab, void (*objdestroyfunc)(void *
* \retval 1 on success
* \retval 0 if there's a problem
*/
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
int _ast_hashtab_insert_immediate(struct ast_hashtab *tab, const void *obj, const char *file, int lineno, const char *func);
#define ast_hashtab_insert_immediate(a,b) _ast_hashtab_insert_immediate(a, b, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#else
@@ -311,7 +311,7 @@ int ast_hashtab_insert_immediate(struct ast_hashtab *tab, const void *obj);
* \retval 1 on success
* \retval 0 if there's a problem
*/
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
int _ast_hashtab_insert_immediate_bucket(struct ast_hashtab *tab, const void *obj, unsigned int h, const char *file, int lineno, const char *func);
#define ast_hashtab_insert_immediate_bucket(a,b,c) _ast_hashtab_insert_immediate_bucket(a, b, c, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#else
@@ -324,7 +324,7 @@ int ast_hashtab_insert_immediate_bucket(struct ast_hashtab *tab, const void *obj
* \retval 1 on success
* \retval 0 if there's a problem, or it's already there.
*/
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
int _ast_hashtab_insert_safe(struct ast_hashtab *tab, const void *obj, const char *file, int lineno, const char *func);
#define ast_hashtab_insert_safe(a,b) _ast_hashtab_insert_safe(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#else
@@ -362,7 +362,7 @@ int ast_hashtab_size( struct ast_hashtab *tab);
int ast_hashtab_capacity( struct ast_hashtab *tab);
/*! \brief Return a copy of the hash table */
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
struct ast_hashtab *_ast_hashtab_dup(struct ast_hashtab *tab, void *(*obj_dup_func)(const void *obj), const char *file, int lineno, const char *func);
#define ast_hashtab_dup(a,b) _ast_hashtab_dup(a,b,__FILE__,__LINE__,__PRETTY_FUNCTION__)
#else
@@ -370,7 +370,7 @@ struct ast_hashtab *ast_hashtab_dup(struct ast_hashtab *tab, void *(*obj_dup_fun
#endif
/*! \brief Gives an iterator to hastable */
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
struct ast_hashtab_iter *_ast_hashtab_start_traversal(struct ast_hashtab *tab, const char *file, int lineno, const char *func);
#define ast_hashtab_start_traversal(a) _ast_hashtab_start_traversal(a,__FILE__,__LINE__,__PRETTY_FUNCTION__)
#else
@@ -395,7 +395,7 @@ void *ast_hashtab_remove_this_object(struct ast_hashtab *tab, void *obj);
/* ------------------ */
/*! \brief Gives an iterator to hastable */
-#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
+#ifdef __AST_DEBUG_MALLOC
struct ast_hashtab_iter *_ast_hashtab_start_write_traversal(struct ast_hashtab *tab, const char *file, int lineno, const char *func);
#define ast_hashtab_start_write_traversal(a) _ast_hashtab_start_write_traversal(a,__FILE__,__LINE__,__PRETTY_FUNCTION__)
#else