Created
October 15, 2011 10:51
-
-
Save anaisbetts/1289394 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Provides convenient way to check whether memory allocation have succeeded. | |
| #define alloc_assert(x) \ | |
| do {\ | |
| if (unlikely (!x)) {\ | |
| fprintf (stderr, "FATAL ERROR: OUT OF MEMORY (%s:%d)\n",\ | |
| __FILE__, __LINE__);\ | |
| _abort ("OUT OF MEMORY");\ | |
| }\ | |
| } while (false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment