Skip to content

Instantly share code, notes, and snippets.

@passingloop
Created October 25, 2011 06:44
Show Gist options
  • Save passingloop/1311604 to your computer and use it in GitHub Desktop.
Save passingloop/1311604 to your computer and use it in GitHub Desktop.
ただ malloc し続けるだけのプログラム
#include <stdio.h>
#include <stdlib.h>
#define GB 1073741824
int main()
{
char *p;
int i = 0;
do {
p = (char *)malloc(GB);
} while (p != NULL && ++i);
printf("%dGB\n", i);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment