File: testmem.c

package info (click to toggle)
gman 0.9.3-5.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 652 kB
  • sloc: ansic: 7,389; makefile: 131; perl: 105
file content (17 lines) | stat: -rw-r--r-- 203 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>
#include <stdio.h>

void main()
{
	int i;
	void *a,*b;
	for (i = 1;i<100;i++)
	{
		a = malloc(i);
		b = malloc(1);
		printf("i = %d, space = %d\n",i,b-a);
		free(b);
		free(a);
	}
}