Deprecate pthreads vcos_get_free_mem()
authorLuke Diamand <luke@diamand.org>
Fri, 23 Sep 2016 22:22:05 +0000 (23:22 +0100)
committerLuke Diamand <luke@diamand.org>
Thu, 29 Sep 2016 07:17:14 +0000 (08:17 +0100)
The pthreads version of vcos_get_free_mem() isn't used anywhere
and causes compiler warnings due to its use of sbrk() without
the relevant #defines.

Ideally it should look at something like /proc/vmstat, but
that's not what it does.

So turn it into a stub function and mark it deprecated. The
VMCS version will carry on working as before.

See issue #316.

interface/vcos/pthreads/vcos_platform.h

index 465abd29719404e0f29af09c3b6da85e72b42f28..fe829d96251f5f3885eb23a5e7a0ee38980a3892 100755 (executable)
@@ -674,11 +674,11 @@ void vcos_atomic_flags_delete(VCOS_ATOMIC_FLAGS_T *atomic_flags)
 
 #if defined(linux) || defined(_HAVE_SBRK)
 
-/* not exactly the free memory, but a measure of it */
+/* Returns invalid result, do not use */
 
 VCOS_INLINE_IMPL
-unsigned long vcos_get_free_mem(void) {
-   return (unsigned long)sbrk(0);
+unsigned long VCOS_DEPRECATED("returns invalid result") vcos_get_free_mem(void) {
+   return 0;
 }
 
 #endif