[sr-dev] git:master:aa458a62: core: mem - define mem_counter struct in meminfo

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 9 18:00:12 CEST 2020


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-09-09T17:50:24+02:00

core: mem - define mem_counter struct in meminfo

- it is the same for f/q/tlsf mallocs

---

Modified: src/core/mem/f_malloc.h
Modified: src/core/mem/meminfo.h
Modified: src/core/mem/q_malloc.h
Modified: src/core/mem/tlsf_malloc.h

---

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

---

diff --git a/src/core/mem/f_malloc.h b/src/core/mem/f_malloc.h
index d338f5c5d3..2bed0b8e53 100644
--- a/src/core/mem/f_malloc.h
+++ b/src/core/mem/f_malloc.h
@@ -241,17 +241,5 @@ void fm_sums(void* qmp);
 void fm_mod_get_stats(void* qm, void **fm_root);
 void fm_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-	const char *file;
-	const char *func;
-	const char *mname;
-	unsigned long line;
-
-	unsigned long size;
-	int count;
-
-	struct _mem_counter *next;
-} mem_counter;
-
 #endif
 #endif
diff --git a/src/core/mem/meminfo.h b/src/core/mem/meminfo.h
index 9c7760db34..8b69daa705 100644
--- a/src/core/mem/meminfo.h
+++ b/src/core/mem/meminfo.h
@@ -42,5 +42,17 @@ struct mem_info{
 	unsigned long total_frags; /** number of total memory fragments */
 };
 
+typedef struct _mem_counter{
+	const char *file;
+	const char *func;
+	const char *mname;
+	unsigned long line;
+
+	unsigned long size;
+	int count;
+
+	struct _mem_counter *next;
+} mem_counter;
+
 #endif
 
diff --git a/src/core/mem/q_malloc.h b/src/core/mem/q_malloc.h
index 71e248f527..85d3c86e60 100644
--- a/src/core/mem/q_malloc.h
+++ b/src/core/mem/q_malloc.h
@@ -174,17 +174,5 @@ void qm_sums(void* qm);
 void qm_mod_get_stats(void *qm, void **qm_root);
 void qm_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-	const char *file;
-	const char *func;
-	const char *mname;
-	unsigned long line;
-
-	unsigned long size;
-	int count;
-
-	struct _mem_counter *next;
-} mem_counter;
-
 #endif
 #endif
diff --git a/src/core/mem/tlsf_malloc.h b/src/core/mem/tlsf_malloc.h
index 3fce9cd1e9..4112634b95 100644
--- a/src/core/mem/tlsf_malloc.h
+++ b/src/core/mem/tlsf_malloc.h
@@ -89,18 +89,6 @@ unsigned long tlsf_available(tlsf_t pool);
 void tlsf_mod_get_stats(tlsf_t pool, void **root);
 void tlsf_mod_free_stats(void *root);
 
-typedef struct _mem_counter{
-	const char *file;
-	const char *func;
-	const char *mname;
-	unsigned long line;
-
-	unsigned long size;
-	int count;
-
-	struct _mem_counter *next;
-} mem_counter;
-
 #if defined(__cplusplus)
 };
 #endif




More information about the sr-dev mailing list