diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c index a281f13c3..f9652bb54 100644 --- a/src/util.c +++ b/src/util.c @@ -26,15 +26,18 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.15 2000/09/14 01:21:10 drh Exp $ +** $Id: util.c,v 1.16 2000/10/11 19:28:52 drh Exp $ */ #include "sqliteInt.h" #include <stdarg.h> #include <ctype.h> +/* +** If MEMORY_DEBUG is defined, then use versions of malloc() and +** free() that track memory usage and check for buffer overruns. +*/ #ifdef MEMORY_DEBUG - /* ** Allocate new memory and set it to zero. Return NULL if ** no memory is available. @@ -164,9 +167,14 @@ char *sqliteStrNDup_(const char *z, int n, char *zFile, int line){ } return zNew; } +#endif /* MEMORY_DEBUG */ +/* +** The following versions of malloc() and free() are for use in a +** normal build. +*/ +#if !defined(MEMORY_DEBUG) -#else /* !defined(MEMORY_DEBUG) */ /* ** Allocate new memory and set it to zero. Return NULL if ** no memory is available. @@ -219,7 +227,7 @@ char *sqliteStrNDup(const char *z, int n){ } return zNew; } -#endif /* MEMORY_DEBUG */ +#endif /* !defined(MEMORY_DEBUG) */ /* ** Create a string from the 2nd and subsequent arguments (up to the |