Changeset 3903
- Timestamp:
- May 12, 2005, 8:03:48 AM (21 years ago)
- Location:
- trunk/Ohana/src/libohana
- Files:
-
- 2 added
- 2 edited
-
Makefile (modified) (2 diffs)
-
include/ohana.h (modified) (1 diff)
-
include/ohana_allocate.h (added)
-
src/ohana_allocate.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/Makefile
r3609 r3903 23 23 INC1 = \ 24 24 $(DESTINC)/Xohana.h \ 25 $(DESTINC)/ohana_allocate.h \ 25 26 $(DESTINC)/ohana.h 26 27 … … 32 33 33 34 OBJ1 = \ 35 $(SRC)/ohana_allocate.$(ARCH).o \ 34 36 $(SRC)/version.$(ARCH).o \ 35 37 $(SRC)/string.$(ARCH).o \ -
trunk/Ohana/src/libohana/include/ohana.h
r3649 r3903 76 76 */ 77 77 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> 97 81 98 82 # ifndef FOPEN
Note:
See TracChangeset
for help on using the changeset viewer.
