Created
August 16, 2012 15:21
-
-
Save metalefty/3370976 to your computer and use it in GitHub Desktop.
メモリお掃除的な何か。メモリ掃除の類の操作に意味があるかは否定的な立場だけど、とりあえず作ってみた。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define SIZE sizeof(int) * 1024 * 1024 * 1024 / 2 - 1 | |
/* Usage: $ dd if=/dev/zero bs=1m count=768 | ./a.out */ | |
int main(void) | |
{ | |
char *c = malloc(SIZE); | |
fgets(c, SIZE, stdin); | |
free(c); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
callocでどうかな