commit
88490b1846
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,28 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MB_BYTES (1024*1024)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned long *p;
|
||||
int i = 0;
|
||||
int nr_mb;
|
||||
int bytes;
|
||||
int max;
|
||||
|
||||
printf("please specify how many memory to alloc\n");
|
||||
scanf("%d", &nr_mb);
|
||||
|
||||
bytes = nr_mb * MB_BYTES;
|
||||
max = bytes / 8;
|
||||
p = malloc(bytes);
|
||||
|
||||
for (i = 0; i < max; i++)
|
||||
*(p + i) = i;
|
||||
|
||||
while(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue