This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 22nd, 2011  |  syntax: C  |  size: 0.30 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data