Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/lamont/src/include/Diderot/diderot.h
ViewVC logotype

Diff of /branches/lamont/src/include/Diderot/diderot.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2201, Sun Feb 24 16:02:12 2013 UTC revision 2202, Sun Feb 24 17:22:25 2013 UTC
# Line 110  Line 110 
110      }      }
111      return p;      return p;
112  }  }
113    STATIC_INLINE void *CheckedReAlloc (void * ptr, size_t szb)
114    {
115        void *p = realloc(ptr,szb);
116        if (p == 0) {
117            fprintf (stderr, "fatal error: unable to reallocate %d bytes of memory\n", (int)szb);
118            exit (1);
119        }
120        return p;
121    }
122    
123    
124  #define NEW(ty)         (ty *)CheckedAlloc(sizeof(ty))  #define NEW(ty)         (ty *)CheckedAlloc(sizeof(ty))
125  #define NEWVEC(ty,n)    (ty *)CheckedAlloc(sizeof(ty) * (n))  #define NEWVEC(ty,n)    (ty *)CheckedAlloc(sizeof(ty) * (n))

Legend:
Removed from v.2201  
changed lines
  Added in v.2202

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0