summaryrefslogtreecommitdiffstats
path: root/man1/memusage.1
diff options
context:
space:
mode:
Diffstat (limited to 'man1/memusage.1')
-rw-r--r--man1/memusage.114
1 files changed, 7 insertions, 7 deletions
diff --git a/man1/memusage.1 b/man1/memusage.1
index e9c656825..aeca54bb0 100644
--- a/man1/memusage.1
+++ b/man1/memusage.1
@@ -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);
}