IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2005, 8:03:48 AM (21 years ago)
Author:
eugene
Message:

adding ohana memory tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r3649 r3903  
    7676*/
    7777
    78 # ifndef ALLOCATE
    79 # define ALLOCATE(X,T,S)  \
    80   X = (T *) malloc ((unsigned)(MAX(((S)*((int)sizeof(T))),1))); \
    81   if (X == NULL) { \
    82     fprintf(stderr,"failed malloc at %d in %s\n", __LINE__, __FILE__);\
    83     exit (10); }
    84 # define REALLOCATE(X,T,S) \
    85   X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \
    86   if (X == NULL) { \
    87     fprintf(stderr,"failed realloc at %d in %s\n", __LINE__, __FILE__);\
    88     exit (10); }
    89 # define CHECK_REALLOCATE(X,T,S,N,D) \
    90   if ((N) >= (S)) { \
    91     S += D; \
    92     X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \
    93     if (X == NULL) { \
    94       fprintf(stderr,"failed realloc increment at %d in %s\n", __LINE__, __FILE__);\
    95       exit (10); } }
    96 # endif /* ALLOCATE */
     78/* ohana_allocate.h provides ohana memory tools.  to use them
     79   you must # define OHANA_MEMORY before including ohana.h */
     80# include <ohana_allocate.h>
    9781
    9882# ifndef FOPEN
Note: See TracChangeset for help on using the changeset viewer.