summaryrefslogtreecommitdiff
path: root/include/asterisk/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r--include/asterisk/utils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 81637e50b..714574b19 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -362,6 +362,19 @@ void * attribute_malloc _ast_calloc(size_t num, size_t len, const char *file, in
)
/*!
+ * \brief A wrapper for calloc() for use in cache pools
+ *
+ * ast_calloc_cache() is a wrapper for calloc() that will generate an Asterisk log
+ * message in the case that the allocation fails. When memory debugging is in use,
+ * the memory allocated by this function will be marked as 'cache' so it can be
+ * distinguished from normal memory allocations.
+ *
+ * The arguments and return value are the same as calloc()
+ */
+#define ast_calloc_cache(num, len) \
+ _ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+/*!
* \brief A wrapper for realloc()
*
* ast_realloc() is a wrapper for realloc() that will generate an Asterisk log