Skip to content

Commit

Permalink
* malloc/memusagestat.c: Silence warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 9, 2006
1 parent 1d05c2f commit 0c1c6c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2006-08-09 Ulrich Drepper <drepper@redhat.com>

* malloc/memusagestat.c: Silence warnings.

* malloc/malloc.c: Dynamically size mmap treshold if the program
frees mmaped blocks.
Patch by Valerie Henson and Arjan van de Ven.
Expand Down
25 changes: 14 additions & 11 deletions malloc/memusagestat.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Generate graphic from memory profiling data.
Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
Expand Down Expand Up @@ -277,16 +277,16 @@ main (int argc, char *argv[])

gdImageString (im_out, gdFontSmall, 38, ysize - 14, (unsigned char *) "0",
blue);
snprintf(buf, sizeof (buf), heap_format, 0);
snprintf (buf, sizeof (buf), heap_format, 0);
gdImageString (im_out, gdFontSmall, maxsize_heap < 1024 ? 32 : 26,
ysize - 26, buf, red);
snprintf(buf, sizeof (buf), stack_format, 0);
ysize - 26, (unsigned char *) buf, red);
snprintf (buf, sizeof (buf), stack_format, 0);
gdImageString (im_out, gdFontSmall, xsize - 37, ysize - 26,
buf, green);
(unsigned char *) buf, green);

if (string != NULL)
gdImageString (im_out, gdFontLarge, (xsize - strlen (string) * 8) / 2,
2, (char *) string, green);
2, (unsigned char *) string, green);

gdImageStringUp (im_out, gdFontSmall, 1, ysize / 2 - 10,
(unsigned char *) "allocated", red);
Expand All @@ -299,9 +299,11 @@ main (int argc, char *argv[])
(unsigned char *) "stack", green);

snprintf (buf, sizeof (buf), heap_format, maxsize_heap / heap_scale);
gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6, 14, buf, red);
gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6, 14,
(unsigned char *) buf, red);
snprintf (buf, sizeof (buf), stack_format, maxsize_stack / stack_scale);
gdImageString (im_out, gdFontSmall, xsize - 37, 14, buf, green);
gdImageString (im_out, gdFontSmall, xsize - 37, 14,
(unsigned char *) buf, green);

for (line = 1; line <= 3; ++line)
{
Expand All @@ -312,7 +314,7 @@ main (int argc, char *argv[])
snprintf (buf, sizeof (buf), heap_format, maxsize_heap / 4 * line /
heap_scale);
gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6,
ysize - 26 - cnt, buf, red);
ysize - 26 - cnt, (unsigned char *) buf, red);

cnt2 = ((ysize - 40) * (maxsize_stack / 4 * line / stack_scale)) /
(maxsize_stack / stack_scale);
Expand All @@ -322,11 +324,12 @@ main (int argc, char *argv[])
snprintf (buf, sizeof (buf), stack_format, maxsize_stack / 4 * line /
stack_scale);
gdImageString (im_out, gdFontSmall, xsize - 37, ysize - 26 - cnt2,
buf, green);
(unsigned char *) buf, green);
}

snprintf (buf, sizeof (buf), "%llu", (unsigned long long) total);
gdImageString (im_out, gdFontSmall, xsize - 50, ysize - 14, buf, blue);
gdImageString (im_out, gdFontSmall, xsize - 50, ysize - 14,
(unsigned char *) buf, blue);

if (!time_based)
{
Expand Down

0 comments on commit 0c1c6c6

Please sign in to comment.