[BACK]Return to memory.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/memory.c between version 1.4 and 1.5

version 1.4, 2007/09/16 10:43:53 version 1.5, 2008/01/29 22:23:10
Line 49 
Line 49 
 #include "memory.h"  #include "memory.h"
   
 static void enomem(size_t);  static void enomem(size_t);
   static void enocmem(size_t, size_t);
   
 /*  /*
  * emalloc --   * emalloc --
Line 99 
Line 100 
         void *p;          void *p;
   
         if ((p = calloc(s1, s2)) == NULL)          if ((p = calloc(s1, s2)) == NULL)
                 enomem(s1 * s2);                  enocmem(s1, s2);
         return p;          return p;
 }  }
   
   void *
   erecalloc(void *ptr, size_t s1, size_t s2)
   {
           if ((ptr = recalloc(ptr, s1, s2)) == NULL)
                   enocmem(s1, s2);
           return ptr;
   }
   
 /* Support routines for hash tables.  */  /* Support routines for hash tables.  */
 void *  void *
 hash_alloc(size_t s, void *u UNUSED)  hash_alloc(size_t s, void *u UNUSED)
Line 131 
Line 140 
 void  void
 enomem(size_t size)  enomem(size_t size)
 {  {
         fprintf(stderr, "make: %s (%lu)\n", strerror(errno), (u_long)size);          fprintf(stderr, "make: %s (%zu)\n", strerror(errno), size);
         exit(2);          exit(2);
 }  }
   
   void
   enocmem(size_t sz1, size_t sz2)
   {
           fprintf(stderr, "make: %s (%zu * %zu)\n", strerror(errno), sz1, sz2);
           exit(2);
   }
 /*  /*
  * esetenv --   * esetenv --
  *      change environment, die on error.   *      change environment, die on error.

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5