Browse code

mem: TLSF: fix typo + missing declaration

Camille Oudot authored on 22/04/2015 16:49:19
Showing 2 changed files
... ...
@@ -912,6 +912,7 @@ tlsf_t tlsf_create(void* mem)
912 912
 	tlsf_cast(control_t*, mem)->allocated = 0;
913 913
 	tlsf_cast(control_t*, mem)->total_size = tlsf_size();
914 914
 	tlsf_cast(control_t*, mem)->fragments = 0;
915
+	tlsf_cast(control_t*, mem)->max_fragments = 0;
915 916
 #endif
916 917
 	return tlsf_cast(tlsf_t, mem);
917 918
 }
... ...
@@ -1106,7 +1107,7 @@ void tlsf_meminfo(tlsf_t pool, struct mem_info *info)
1106 1107
 	memset(info, 0, sizeof(*info));
1107 1108
 	info->free = control->total_size - control->real_used;
1108 1109
 	info->max_used = control->max_used;
1109
-	info->real_used = control->max_used;
1110
+	info->real_used = control->real_used;
1110 1111
 	info->total_frags = control->fragments;
1111 1112
 	info->used = control->allocated;
1112 1113
 	info->total_size = control->total_size;
... ...
@@ -64,6 +64,7 @@ int tlsf_check(tlsf_t tlsf);
64 64
 int tlsf_check_pool(pool_t pool);
65 65
 
66 66
 void tlsf_meminfo(tlsf_t pool, struct mem_info *info);
67
+size_t tlsf_available(tlsf_t pool);
67 68
 
68 69
 #if defined(__cplusplus)
69 70
 };