[sr-dev] git:master:1cc3f0dd: core: mem - updated defines for sys malloc and mem error log messages

Daniel-Constantin Mierla miconda at gmail.com
Sat Jul 1 09:11:38 CEST 2017


Module: kamailio
Branch: master
Commit: 1cc3f0ddfc517ed2b1f7820f9feedee8a91d0ac7
URL: https://github.com/kamailio/kamailio/commit/1cc3f0ddfc517ed2b1f7820f9feedee8a91d0ac7

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-01T09:11:12+02:00

core: mem - updated defines for sys malloc and mem error log messages

---

Modified: src/core/mem/mem.h
Modified: src/core/mem/pkg.h

---

Diff:  https://github.com/kamailio/kamailio/commit/1cc3f0ddfc517ed2b1f7820f9feedee8a91d0ac7.diff
Patch: https://github.com/kamailio/kamailio/commit/1cc3f0ddfc517ed2b1f7820f9feedee8a91d0ac7.patch

---

diff --git a/src/core/mem/mem.h b/src/core/mem/mem.h
index ae2669b9a6..2a06020f82 100644
--- a/src/core/mem/mem.h
+++ b/src/core/mem/mem.h
@@ -19,7 +19,7 @@
 /**
  * \defgroup mem Kamailio memory manager
  * \brief  Kamailio internal memory manager
- * 
+ *
  * Kamailio internal memory manager for private (per process) and shared
  * memory pools. It provides several different strategies for the memory
  * management, like really fast, with extended debugging and also plain system
@@ -29,7 +29,7 @@
 /**
  * \file
  * \brief Main definitions for memory manager
- * 
+ *
  * \brief Main definitions for memory manager, like malloc, free and realloc
  * \ingroup mem
  */
@@ -193,12 +193,12 @@ int init_shm_mallocs(int force_alloc);
 #endif
 
 /** generic logging helper for allocation errors in private memory pool/ system */
-#ifdef SYSTEM_MALLOC
-#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from system")
+#ifdef SYS_MALLOC
+#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from sys pool\n")
 #else
-#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from available pool")
+#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from pkg pool\n")
 #endif
 /** generic logging helper for allocation errors in shared memory pool */
-#define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from available pool")
+#define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from shm pool\n")
 
 #endif
diff --git a/src/core/mem/pkg.h b/src/core/mem/pkg.h
index c107117412..3736625e72 100644
--- a/src/core/mem/pkg.h
+++ b/src/core/mem/pkg.h
@@ -52,10 +52,12 @@ void pkg_print_manager(void);
 #	define pkg_mod_free_stats(x)    _pkg_root.xfmodstats(x)
 
 #else /*PKG_MALLOC*/
+
 /* use system allocator */
+#	define SYS_MALLOC
 #	include <stdlib.h>
 #	include "memdbg.h"
-#	ifdef DBG_SYS_MALLOC
+#	ifdef DBG_SYS_MEMORY
 #	define pkg_malloc(s) \
 	(  { void *____v123; ____v123=malloc((s)); \
 	   MDBG("malloc %p size %lu end %p (%s:%d)\n", ____v123, (unsigned long)(s), (char*)____v123+(s), __FILE__, __LINE__);\




More information about the sr-dev mailing list