Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdlib.h>
  3. #include <io.h>
  4. #include <unistd.h>
  5.  
  6. static char msg[] = "Fatal: malloc returned NULL\r\n";
  7.  
  8. void * xmalloc(size_t _sz);
  9. void *
  10. xmalloc(size_t _sz)
  11. {
  12.   void *rv = malloc(_sz?_sz:1);
  13.   if (rv == 0)
  14.   {
  15.     __libclog_printf(msg);
  16.     _exit(1);
  17.   }
  18.   return rv;
  19. }
  20.