Skip to content

Instantly share code, notes, and snippets.

@cooperq
Created January 15, 2014 20:13
Show Gist options
  • Save cooperq/8443635 to your computer and use it in GitHub Desktop.
Save cooperq/8443635 to your computer and use it in GitHub Desktop.
malloc malloc malloc malloc all day long malloc malloc malloc this is the malloc song!
#include <stdlib.h>
#include <stdio.h>
void main(){
printf("Allocating all the memory...\n");
while(1){
int *buffer = malloc(1024);
if(buffer == NULL){
printf("could not allocate any more memory\n");
}
}
printf("quitting...\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment