From: Bart Van Assche Date: Tue, 22 Apr 2008 17:25:29 +0000 (+0000) Subject: Took into account that mallinfo() is not supported on all platforms. X-Git-Tag: svn/VALGRIND_3_4_0~709 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb0f687673adc43359434faa6829d2bb1da183ea;p=thirdparty%2Fvalgrind.git Took into account that mallinfo() is not supported on all platforms. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7907 --- diff --git a/memcheck/tests/mallinfo.c b/memcheck/tests/mallinfo.c index b8a281bd1f..5ff258e8e6 100644 --- a/memcheck/tests/mallinfo.c +++ b/memcheck/tests/mallinfo.c @@ -2,10 +2,13 @@ #include #include #include // getopt() +#include "../config.h" static int s_quiet = 0; + +#if defined(HAVE_MALLINFO) static size_t check(size_t min, size_t max) { struct mallinfo mi; @@ -26,6 +29,7 @@ static size_t check(size_t min, size_t max) printf("fordblks = %d\n", mi.fordblks); /* total free space */ printf("keepcost = %d\n", mi.keepcost); /* top-most, releasable (via malloc_trim) space */ printf("(min = %zu, max = %zu)\n", min, max); + printf("\n"); } // size checks @@ -66,6 +70,17 @@ static size_t check(size_t min, size_t max) return used; } +#else +static size_t check(size_t min, size_t max) +{ + if (! s_quiet) + { + printf("mallinfo() is not supported on this platform.\n"); + printf("\n"); + } + return 0; +} +#endif int main(int argc, char** argv) {