IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3903


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

adding ohana memory tools

Location:
trunk/Ohana/src/libohana
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/Makefile

    r3609 r3903  
    2323INC1 = \
    2424$(DESTINC)/Xohana.h  \
     25$(DESTINC)/ohana_allocate.h \
    2526$(DESTINC)/ohana.h
    2627
     
    3233
    3334OBJ1 = \
     35$(SRC)/ohana_allocate.$(ARCH).o  \
    3436$(SRC)/version.$(ARCH).o         \
    3537$(SRC)/string.$(ARCH).o          \
  • 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.