Make arrangements to optionally print a debug message at the point
of a simulated malloc() failure when SQLITE_MEMDEBUG is defined. (CVS 4077) FossilOrigin-Name: 7d3c1f08a34fcf2ca5c79d6e58f713ae6a4b34e8
This commit is contained in:
+9
-4
@@ -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.255 2007/06/15 18:53:15 drh Exp $
|
||||
** $Id: test1.c,v 1.256 2007/06/15 20:29:20 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -4445,7 +4445,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
extern int sqlite3_sync_count, sqlite3_fullsync_count;
|
||||
extern int sqlite3_opentemp_count;
|
||||
extern int sqlite3_memUsed;
|
||||
extern char *sqlite3_malloc_id;
|
||||
extern int sqlite3_memMax;
|
||||
extern int sqlite3_like_count;
|
||||
extern int sqlite3_tsd_count;
|
||||
@@ -4516,8 +4515,14 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
(char*)&pzNeededCollation, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
|
||||
#endif
|
||||
#ifdef SQLITE_MEMDEBUG
|
||||
Tcl_LinkVar(interp, "sqlite_malloc_id",
|
||||
(char*)&sqlite3_malloc_id, TCL_LINK_STRING);
|
||||
{
|
||||
extern char *sqlite3_malloc_id;
|
||||
extern int sqlite3_mallocfail_trace;
|
||||
Tcl_LinkVar(interp, "sqlite_malloc_id",
|
||||
(char*)&sqlite3_malloc_id, TCL_LINK_STRING);
|
||||
Tcl_LinkVar(interp, "sqlite3_mallocfail_trace",
|
||||
(char*)&sqlite3_mallocfail_trace, TCL_LINK_INT);
|
||||
}
|
||||
#endif
|
||||
#if OS_WIN
|
||||
Tcl_LinkVar(interp, "sqlite_os_type",
|
||||
|
||||
Reference in New Issue
Block a user