diff options
-rw-r--r-- | utils.c | 29 | ||||
-rw-r--r-- | utils.h | 8 |
2 files changed, 0 insertions, 37 deletions
@@ -52,35 +52,6 @@ uCalloc(unsigned n, unsigned size) /***====================================================================***/ -Opaque -uRealloc(Opaque old, unsigned newSize) -{ - if (old == NULL) - return ((Opaque) malloc(newSize)); - else - return ((Opaque) realloc((char *) old, newSize)); -} - -/***====================================================================***/ - -Opaque -uRecalloc(Opaque old, unsigned nOld, unsigned nNew, unsigned itemSize) -{ - char *rtrn; - - if (old == NULL) - rtrn = (char *) calloc(nNew, itemSize); - else { - rtrn = (char *) realloc((char *) old, nNew * itemSize); - if ((rtrn) && (nNew > nOld)) { - bzero(&rtrn[nOld * itemSize], (nNew - nOld) * itemSize); - } - } - return (Opaque) rtrn; -} - -/***====================================================================***/ - void uFree(Opaque ptr) { @@ -79,18 +79,10 @@ typedef int Comparison; extern Opaque uAlloc(unsigned /* size */); extern Opaque uCalloc(unsigned /* n */ , unsigned /* size */); -extern Opaque uRealloc(Opaque /* old */ , - unsigned /* newSize */); -extern Opaque uRecalloc(Opaque /* old */ , - unsigned /* nOld */ , - unsigned /* nNew */ , - unsigned /* newSize */); extern void uFree(Opaque /* ptr */); #define uTypedAlloc(t) ((t *)uAlloc((unsigned)sizeof(t))) #define uTypedCalloc(n,t) ((t *)uCalloc((unsigned)n,(unsigned)sizeof(t))) -#define uTypedRealloc(pO,n,t) ((t *)uRealloc((Opaque)pO,((unsigned)n)*sizeof(t))) -#define uTypedRecalloc(pO,o,n,t) ((t *)uRecalloc((Opaque)pO,((unsigned)o),((unsigned)n),sizeof(t))) #if (defined mdHasAlloca) && (mdHasAlloca) #define uTmpAlloc(n) ((Opaque)alloca((unsigned)n)) #define uTmpFree(p) |