git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9101
91ce42f0-d328-0410-95d8-
f526ca767f89
#define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
#endif
-/* Function to simplify free/reset pointers */
-inline void bfree_and_null(void *&a) { if (a) { free(a); a = NULL; } }
+/* Macro to simplify free/reset pointers */
+#define bfree_and_null(a) do{if(a){free(a); (a)=NULL;}} while(0)
/*
* Replace codes needed in both file routines and non-file routines
#endif
-/* Function to simplify free/reset pointers */
-inline void bfree_and_null(POOLMEM *&a) {
- if (a) {
- free_pool_memory(a);
- a = NULL;
- }
-}
-
-#define free_and_null_pool_memory(a) bfree_and_null((a))
+/* Macro to simplify free/reset pointers */
+#define bfree_and_null_pool_memory(a) do{if(a){free_pool_memory(a); (a)=NULL;}} while(0)
extern void garbage_collect_memory_pool();
extern void close_memory_pool();