Skip to content

Instantly share code, notes, and snippets.

@phemmer
Created April 20, 2015 14:32
Show Gist options
  • Select an option

  • Save phemmer/fff60f857ee8ca5a74cd to your computer and use it in GitHub Desktop.

Select an option

Save phemmer/fff60f857ee8ca5a74cd to your computer and use it in GitHub Desktop.
2gb malloc
#include <stdlib.h>
#include <stdio.h>
int main() {
char *buf;
int i;
for (i = 0; i < 2048; i++) {
buf = (char *) malloc(1024*1024);
printf("buf=%p\n", buf);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment