[sr-dev] git:master:33fe5e38: core: mem - export pkg api even when using system malloc

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 28 10:58:02 CEST 2016


Module: kamailio
Branch: master
Commit: 33fe5e38d2eefc2244eccb6279c082a789ed0307
URL: https://github.com/kamailio/kamailio/commit/33fe5e38d2eefc2244eccb6279c082a789ed0307

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-03-27T11:39:09+02:00

core: mem - export pkg api even when using system malloc

---

Modified: Makefile.defs
Modified: mem/pkg.h

---

Diff:  https://github.com/kamailio/kamailio/commit/33fe5e38d2eefc2244eccb6279c082a789ed0307.diff
Patch: https://github.com/kamailio/kamailio/commit/33fe5e38d2eefc2244eccb6279c082a789ed0307.patch

---

diff --git a/Makefile.defs b/Makefile.defs
index 3f3d830..9613136 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -626,7 +626,6 @@ C_DEFS= $(extra_defs) \
 	 -DSER_VER=$(SER_VER) \
 	 -DCFG_DIR='"$(cfg_target)"'\
 	 -DRUN_DIR='"$(run_target)"'\
-	 -DPKG_MALLOC \
 	 -DSHM_MEM  -DSHM_MMAP \
 	 -DDNS_IP_HACK \
 	 -DUSE_MCAST \
diff --git a/mem/pkg.h b/mem/pkg.h
index 82e430a..eb07bd2 100644
--- a/mem/pkg.h
+++ b/mem/pkg.h
@@ -20,12 +20,17 @@
 #ifndef _sr_pkg_h_
 #define _sr_pkg_h_
 
-#ifdef PKG_MALLOC
-
 #include "memapi.h"
 
 extern sr_pkg_api_t _pkg_root;
 
+int pkg_init_api(sr_pkg_api_t *ap);
+int pkg_init_manager(char *name);
+void pkg_destroy_manager(void);
+void pkg_print_manager(void);
+
+#ifdef PKG_MALLOC
+
 #ifdef DBG_SR_MEMORY
 #	define pkg_malloc(s)      _pkg_root.xmalloc(_pkg_root.mem_block, (s), _SRC_LOC_, \
 				_SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_)
@@ -46,11 +51,6 @@ extern sr_pkg_api_t _pkg_root;
 #	define pkg_mod_get_stats(x)     _pkg_root.xstats(_pkg_root.mem_block, x)
 #	define pkg_mod_free_stats(x)    _pkg_root.xfstats(x)
 
-int pkg_init_api(sr_pkg_api_t *ap);
-int pkg_init_manager(char *name);
-void pkg_destroy_manager(void);
-void pkg_print_manager(void);
-
 #else /*PKG_MALLOC*/
 /* use system allocator */
 #	include <stdlib.h>
@@ -74,6 +74,8 @@ void pkg_print_manager(void);
 #	define pkg_info(mi) do{ memset((mi),0, sizeof(*(mi))); } while(0)
 #	define pkg_available() 0
 #	define pkg_sums() do{}while(0)
+#	define pkg_mod_get_stats(x)     do{}while(0)
+#	define pkg_mod_free_stats(x)    do{}while(0)
 #endif /*PKG_MALLOC*/
 
 #endif




More information about the sr-dev mailing list