[sr-dev] git:master:0ea1b700: core: mem/tlsf - return unsigned long for function giving available memory

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


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

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

core: mem/tlsf - return unsigned long for function giving available memory

- aling it with mem api prototype

---

Modified: mem/tlsf_malloc.c
Modified: mem/tlsf_malloc.h

---

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

---

diff --git a/mem/tlsf_malloc.c b/mem/tlsf_malloc.c
index 73ae412..2570ae6 100644
--- a/mem/tlsf_malloc.c
+++ b/mem/tlsf_malloc.c
@@ -1138,10 +1138,10 @@ void tlsf_meminfo(tlsf_t pool, struct mem_info *info)
 	info->total_size = control->total_size;
 }
 
-size_t tlsf_available(tlsf_t pool)
+unsigned long tlsf_available(tlsf_t pool)
 {
 	control_t* control = tlsf_cast(control_t*, pool);
-	return control->total_size - control->real_used;
+	return (unsigned long)(control->total_size - control->real_used);
 }
 
 void tlsf_status(tlsf_t pool)
diff --git a/mem/tlsf_malloc.h b/mem/tlsf_malloc.h
index 97e962a..b92ae6f 100644
--- a/mem/tlsf_malloc.h
+++ b/mem/tlsf_malloc.h
@@ -79,7 +79,7 @@ int tlsf_check_pool(pool_t pool);
 void tlsf_meminfo(tlsf_t pool, struct mem_info *info);
 void tlsf_status(tlsf_t pool);
 void tlsf_sums(tlsf_t pool);
-size_t tlsf_available(tlsf_t pool);
+unsigned long tlsf_available(tlsf_t pool);
 void tlsf_mod_get_stats(tlsf_t pool, void **root);
 void tlsf_mod_free_stats(void *root);
 




More information about the sr-dev mailing list