git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7889
fork.stderr.exp fork.stdout.exp fork.vgtest \
fucomip.stderr.exp fucomip.vgtest \
gxx304.stderr.exp gxx304.vgtest \
+ mallinfo.stderr.exp mallinfo.vgtest \
manythreads.stdout.exp manythreads.stderr.exp manythreads.vgtest \
map_unaligned.stderr.exp map_unaligned.vgtest \
map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
fdleak_fcntl fdleak_ipv4 fdleak_open fdleak_pipe \
fdleak_socketpair \
floored fork fucomip manythreads \
+ mallinfo \
munmap_exe map_unaligned map_unmap mq mremap mremap2 \
nestedfns \
pending \
--- /dev/null
+#include <assert.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main(int argc, char** argv)
+{
+ struct mallinfo mi;
+ int allocated, allocated1, allocated2;
+ void* p;
+
+ fprintf(stderr,
+ "Test of mallinfo(). May not trigger any assertion failures.\n");
+
+ mi = mallinfo();
+ assert(mi.arena == mi.uordblks + mi.fordblks);
+ allocated1 = mi.arena + mi.hblkhd;
+ allocated = 128*4096;
+ p = malloc(allocated);
+ mi = mallinfo();
+ assert(mi.arena == mi.uordblks + mi.fordblks);
+ allocated2 = mi.arena + mi.hblkhd;
+ assert(allocated2 - allocated1 >= allocated);
+ free(p);
+
+ return 0;
+}
--- /dev/null
+
+Test of mallinfo(). May not trigger any assertion failures.
+
--- /dev/null
+prog: mallinfo