diff options
Diffstat (limited to 'generic/tclAlloc.c')
| -rw-r--r-- | generic/tclAlloc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 73c9196..675e1a4 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -31,7 +31,7 @@ * until Tcl uses config.h properly. */ -#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__) +#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__) typedef unsigned long caddr_t; #endif @@ -72,7 +72,7 @@ union overhead { #define RMAGIC 0x5555 /* magic # on range info */ #ifndef NDEBUG -#define RSLOP sizeof(unsigned short) +#define RSLOP sizeof (unsigned short) #else #define RSLOP 0 #endif @@ -134,6 +134,7 @@ static int allocInit = 0; */ static unsigned int numMallocs[NBUCKETS+1]; +#include <stdio.h> #endif #if !defined(NDEBUG) @@ -148,7 +149,7 @@ static unsigned int numMallocs[NBUCKETS+1]; * Prototypes for functions used only in this file. */ -static void MoreCore(int bucket); +static void MoreCore(int bucket); /* *------------------------------------------------------------------------- @@ -457,7 +458,7 @@ TclpFree( } Tcl_MutexLock(allocMutexPtr); - overPtr = (union overhead *)((caddr_t)oldPtr - sizeof(union overhead)); + overPtr = (union overhead *)((caddr_t)oldPtr - sizeof (union overhead)); ASSERT(overPtr->overMagic0 == MAGIC); /* make sure it was in use */ ASSERT(overPtr->overMagic1 == MAGIC); @@ -526,7 +527,7 @@ TclpRealloc( Tcl_MutexLock(allocMutexPtr); - overPtr = (union overhead *)((caddr_t)oldPtr - sizeof(union overhead)); + overPtr = (union overhead *)((caddr_t)oldPtr - sizeof (union overhead)); ASSERT(overPtr->overMagic0 == MAGIC); /* make sure it was in use */ ASSERT(overPtr->overMagic1 == MAGIC); @@ -694,9 +695,9 @@ mstats( char * TclpAlloc( - size_t numBytes) /* Number of bytes to allocate. */ + unsigned int numBytes) /* Number of bytes to allocate. */ { - return (char *) malloc(numBytes); + return (char*) malloc(numBytes); } /* @@ -742,9 +743,9 @@ TclpFree( char * TclpRealloc( char *oldPtr, /* Pointer to alloced block. */ - size_t numBytes) /* New size of memory. */ + unsigned int numBytes) /* New size of memory. */ { - return (char *) realloc(oldPtr, numBytes); + return (char*) realloc(oldPtr, numBytes); } #endif /* !USE_TCLALLOC */ |
