diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sqliteInt.h | 19 | ||||
-rw-r--r-- | src/test1.c | 4 | ||||
-rw-r--r-- | src/util.c | 4 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index f9c853a03..60cfbd482 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.431 2005/12/09 14:25:08 danielk1977 Exp $ +** @(#) $Id: sqliteInt.h,v 1.432 2005/12/09 14:39:04 danielk1977 Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -245,17 +245,24 @@ extern int sqlite3_iMallocReset; /* Set iMallocFail to this when it reaches 0 */ #define ENTER_MALLOC (\ sqlite3Tsd()->zFile = __FILE__, sqlite3Tsd()->iLine = __LINE__ \ ) -#else -#define ENTER_MALLOC 0 -#endif - -#define sqliteFree(x) sqlite3FreeX(x) #define sqliteMalloc(x) (ENTER_MALLOC, sqlite3Malloc(x)) #define sqliteMallocRaw(x) (ENTER_MALLOC, sqlite3MallocRaw(x)) #define sqliteRealloc(x,y) (ENTER_MALLOC, sqlite3Realloc(x,y)) #define sqliteStrDup(x) (ENTER_MALLOC, sqlite3StrDup(x)) #define sqliteStrNDup(x,y) (ENTER_MALLOC, sqlite3StrNDup(x,y)) +#else + +#define sqliteMalloc(x) sqlite3Malloc(x) +#define sqliteMallocRaw(x) sqlite3MallocRaw(x) +#define sqliteRealloc(x,y) sqlite3Realloc(x,y) +#define sqliteStrDup(x) sqlite3StrDup(x) +#define sqliteStrNDup(x,y) sqlite3StrNDup(x,y) + +#endif + +#define sqliteFree(x) sqlite3FreeX(x) + /* ** An instance of this structure is allocated for each thread that uses SQLite. */ diff --git a/src/test1.c b/src/test1.c index d4e15ac2b..2e733393f 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.172 2005/12/09 14:25:08 danielk1977 Exp $ +** $Id: test1.c,v 1.173 2005/12/09 14:39:04 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -3221,8 +3221,10 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ (char*)&sqlite3_current_time, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_os_trace", (char*)&sqlite3_os_trace, TCL_LINK_INT); +#ifdef SQLITE_MEMDEBUG Tcl_LinkVar(interp, "sqlite_malloc_id", (char*)&sqlite3_malloc_id, TCL_LINK_STRING); +#endif #if OS_WIN Tcl_LinkVar(interp, "sqlite_os_type", (char*)&sqlite3_os_type, TCL_LINK_INT); diff --git a/src/util.c b/src/util.c index ac8677a79..3edc20f4a 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.150 2005/12/09 14:25:09 danielk1977 Exp $ +** $Id: util.c,v 1.151 2005/12/09 14:39:04 danielk1977 Exp $ */ #include "sqliteInt.h" #include <stdarg.h> @@ -1214,7 +1214,7 @@ static SqliteTsd tsd = { #ifndef NDEBUG , 1 /* mallocAllowed flag */ #endif -#ifndef SQLITE_MEMDEBUG +#ifdef SQLITE_MEMDEBUG , 0 , 0 , 0 |