malloc(), realloc().. the dark side powerful it is

Try:

extern "C" 
  {
  #include "memdebug.h"
  }