]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
illumos warnings: malinfo struct fields are 64bit on illumos
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 6 Feb 2026 16:46:33 +0000 (17:46 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 6 Feb 2026 16:54:05 +0000 (17:54 +0100)
memcheck/tests/mallinfo.c
memcheck/tests/sbfragment.c

index d8e853be79c30e2dfea1bd0f07249b027d6a3e1b..cab35241dfc6321d95ba2f639667e8e55cef89b9 100644 (file)
@@ -18,16 +18,16 @@ static size_t check(size_t min, size_t max)
 
   if (! s_quiet)
   {
-    printf("arena = %d\n", mi.arena);      /* non-mmapped space allocated from system */
-    printf("ordblks = %d\n", mi.ordblks);   /* number of free chunks */
-    printf("smblks = %d\n", mi.smblks);            /* number of fastbin blocks */
-    printf("hblks = %d\n", mi.hblks);      /* number of mmapped regions */
-    printf("hblkhd = %d\n", mi.hblkhd);            /* space in mmapped regions */
-    printf("usmblks = %d\n", mi.usmblks);   /* maximum total allocated space */
-    printf("fsmblks = %d\n", mi.fsmblks);   /* space available in freed fastbin blocks */
-    printf("uordblks = %d\n", mi.uordblks); /* total allocated space */
-    printf("fordblks = %d\n", mi.fordblks); /* total free space */
-    printf("keepcost = %d\n", mi.keepcost); /* top-most, releasable (via malloc_trim) space */
+    printf("arena = %lu\n", (unsigned long int)mi.arena);          /* non-mmapped space allocated from system */
+    printf("ordblks = %lu\n", (unsigned long int)mi.ordblks);   /* number of free chunks */
+    printf("smblks = %lu\n", (unsigned long int)mi.smblks);        /* number of fastbin blocks */
+    printf("hblks = %lu\n", (unsigned long int)mi.hblks);          /* number of mmapped regions */
+    printf("hblkhd = %lu\n", (unsigned long int)mi.hblkhd);        /* space in mmapped regions */
+    printf("usmblks = %lu\n", (unsigned long int)mi.usmblks);   /* maximum total allocated space */
+    printf("fsmblks = %lu\n", (unsigned long int)mi.fsmblks);   /* space available in freed fastbin blocks */
+    printf("uordblks = %lu\n", (unsigned long int)mi.uordblks); /* total allocated space */
+    printf("fordblks = %lu\n", (unsigned long int)mi.fordblks); /* total free space */
+    printf("keepcost = %lu\n", (unsigned long int)mi.keepcost); /* top-most, releasable (via malloc_trim) space */
     printf("(min = %zu, max = %zu)\n", min, max);
     printf("\n");
   }
index 545fe3d0d66ab114b7b79a59614924e63e2e336d..d7c9665254b481ad23fb849fb780a128e9eb457b 100644 (file)
@@ -19,16 +19,16 @@ void stats(char *msg)
   printf("%s\n", msg);
 
 #if defined(HAVE_MALLINFO)
-  printf("%10d int arena;    /* non-mmapped space allocated from system */\n", mallinfo_result.arena);
-  printf("%10d int ordblks;  /* number of free chunks */\n", mallinfo_result.ordblks);
-  printf("%10d int smblks;   /* number of fastbin blocks */\n", mallinfo_result.smblks);
-  printf("%10d int hblks;    /* number of mmapped regions */\n", mallinfo_result.hblks);
-  printf("%10d int hblkhd;   /* space in mmapped regions */\n", mallinfo_result.hblkhd);
-  printf("%10d int usmblks;  /* maximum total allocated space */\n", mallinfo_result.usmblks);
-  printf("%10d int fsmblks;  /* space available in freed fastbin blocks */\n", mallinfo_result.fsmblks);
-  printf("%10d int uordblks; /* total allocated space */\n", mallinfo_result.uordblks);
-  printf("%10d int fordblks; /* total free space */\n", mallinfo_result.fordblks);
-  printf("%10d int keepcost; /* top-most, releasable (via malloc_trim) space */\n", mallinfo_result.keepcost);
+  printf("%10lu int arena;    /* non-mmapped space allocated from system */\n", (unsigned long int)mallinfo_result.arena);
+  printf("%10lu int ordblks;  /* number of free chunks */\n", (unsigned long int)mallinfo_result.ordblks);
+  printf("%10lu int smblks;   /* number of fastbin blocks */\n", (unsigned long int)mallinfo_result.smblks);
+  printf("%10lu int hblks;    /* number of mmapped regions */\n", (unsigned long int)mallinfo_result.hblks);
+  printf("%10lu int hblkhd;   /* space in mmapped regions */\n", (unsigned long int)mallinfo_result.hblkhd);
+  printf("%10lu int usmblks;  /* maximum total allocated space */\n", (unsigned long int)mallinfo_result.usmblks);
+  printf("%10lu int fsmblks;  /* space available in freed fastbin blocks */\n", (unsigned long int)mallinfo_result.fsmblks);
+  printf("%10lu int uordblks; /* total allocated space */\n", (unsigned long int)mallinfo_result.uordblks);
+  printf("%10lu int fordblks; /* total free space */\n", (unsigned long int)mallinfo_result.fordblks);
+  printf("%10lu int keepcost; /* top-most, releasable (via malloc_trim) space */\n", (unsigned long int)mallinfo_result.keepcost);
   printf("\n");
 #endif
 }