[sr-dev] git:master:bab8a6b1: core: mem - use size_t for memory management api prototypes

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 8 10:04:54 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-06-08T10:01:51+02:00

core: mem - use size_t for memory management api prototypes

- be compatible with standard malloc(...) prototype

---

Modified: mem/memapi.h

---

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

---

diff --git a/mem/memapi.h b/mem/memapi.h
index 28e9f86..2e1b7fe 100644
--- a/mem/memapi.h
+++ b/mem/memapi.h
@@ -20,27 +20,29 @@
 #ifndef _sr_mem_api_
 #define _sr_mem_api_
 
+#include <string.h>
+
 #include "src_loc.h"
 #include "meminfo.h"
 #include "memdbg.h"
 
 #ifdef DBG_SR_MEMORY
 
-typedef void* (*sr_malloc_f)(void* mbp, unsigned long size,
+typedef void* (*sr_malloc_f)(void* mbp, size_t size,
 					const char* file, const char* func, unsigned int line, const char* mname);
 typedef void  (*sr_free_f)(void* mbp, void* p, const char* file, const char* func,
 					unsigned int line, const char* mname);
-typedef void* (*sr_realloc_f)(void* mbp, void* p, unsigned long size,
+typedef void* (*sr_realloc_f)(void* mbp, void* p, size_t size,
 					const char* file, const char* func, unsigned int line, const char* mname);
-typedef void* (*sr_resize_f)(void* mbp, void* p, unsigned long size,
+typedef void* (*sr_resize_f)(void* mbp, void* p, size_t size,
 					const char* file, const char* func, unsigned int line, const char* mname);
 
 #else /*DBG_SR_MEMORY*/
 
-typedef void* (*sr_malloc_f)(void* mbp, unsigned long size);
+typedef void* (*sr_malloc_f)(void* mbp, size_t size);
 typedef void  (*sr_free_f)(void* mbp, void* p);
-typedef void* (*sr_realloc_f)(void* mbp, void* p, unsigned long size);
-typedef void* (*sr_resize_f)(void* mbp, void* p, unsigned long size);
+typedef void* (*sr_realloc_f)(void* mbp, void* p, size_t size);
+typedef void* (*sr_resize_f)(void* mbp, void* p, size_t size);
 
 #endif /*DBG_SR_MEMORY*/
 




More information about the sr-dev mailing list