SHARE
TWEET

Untitled

a guest Dec 22nd, 2011 19 Never
  1. #include <unistd.h>
  2.  
  3. #define MSG "Look, I just made malloc not do memory allocations.\n" \
  4.                     "How can the compiler tell whether the malloc function actually does allocate memory?\n"
  5.  
  6. void * malloc() {
  7.         write(2, MSG, sizeof(MSG));
  8.         return NULL;
  9. }
  10.  
  11. int main() {
  12.     malloc();
  13.     return 0;
  14. }
RAW Paste Data
Top