summaryrefslogtreecommitdiffstats
path: root/man1/memusage.1
diff options
context:
space:
mode:
Diffstat (limited to 'man1/memusage.1')
-rw-r--r--man1/memusage.116
1 files changed, 8 insertions, 8 deletions
diff --git a/man1/memusage.1 b/man1/memusage.1
index 1e2a572f8..03a5094ee 100644
--- a/man1/memusage.1
+++ b/man1/memusage.1
@@ -2,7 +2,7 @@
.\" and Copyright (C) 2014, Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" SPDX-License-Identifier: GPL-2.0-or-later
-.TH memusage 1 2023-01-07 "Linux man-pages 6.03"
+.TH memusage 1 2023-05-03 "Linux man-pages 6.05.01"
.SH NAME
memusage \- profile memory usage of a program
.SH SYNOPSIS
@@ -223,35 +223,35 @@ $ \fBmemusagestat memusage.dat memusage.png\fP
.EX
#include <stdio.h>
#include <stdlib.h>
-
+\&
#define CYCLES 20
-
+\&
int
main(int argc, char *argv[])
{
int i, j;
size_t size;
int *p;
-
+\&
size = sizeof(*p) * 100;
printf("malloc: %zu\en", size);
p = malloc(size);
-
+\&
for (i = 0; i < CYCLES; i++) {
if (i < CYCLES / 2)
j = i;
else
j\-\-;
-
+\&
size = sizeof(*p) * (j * 50 + 110);
printf("realloc: %zu\en", size);
p = realloc(p, size);
-
+\&
size = sizeof(*p) * ((j + 1) * 150 + 110);
printf("realloc: %zu\en", size);
p = realloc(p, size);
}
-
+\&
free(p);
exit(EXIT_SUCCESS);
}