Skip to content

Instantly share code, notes, and snippets.

@thestinger
Last active February 11, 2016 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thestinger/8b3162c474b8b8410ebb to your computer and use it in GitHub Desktop.
Save thestinger/8b3162c474b8b8410ebb to your computer and use it in GitHub Desktop.
// Clang is clever enough to optimize out these malloc and free calls.
#include <stdio.h>
#include <stdlib.h>
int main(void) {
void *ptr = malloc(16);
if (!ptr) {
puts("side effect");
return 1;
}
free(ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment