1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Check in extra fixes for malloc4.test. (CVS 4341)

FossilOrigin-Name: 49ce3a838194f0316c883dbe1596d13c0c0fad1b
This commit is contained in:
danielk1977
2007-08-30 15:46:06 +00:00
parent 744f574889
commit cd03724cb2
4 changed files with 42 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
C Fixes\sfor\smalloc4.test.\s(CVS\s4340) C Check\sin\sextra\sfixes\sfor\smalloc4.test.\s(CVS\s4341)
D 2007-08-30T15:16:05 D 2007-08-30T15:46:07
F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3 F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -103,7 +103,7 @@ F src/main.c 58f71f9b0c583fbe74d13b6d3fdb509cac5871f3
F src/malloc.c de4e77fe70a9a0ac47a1c3a874422b107231bf31 F src/malloc.c de4e77fe70a9a0ac47a1c3a874422b107231bf31
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
F src/mem1.c afe2fbf6d7e8247c6c9f69c1481358b1cad60c08 F src/mem1.c afe2fbf6d7e8247c6c9f69c1481358b1cad60c08
F src/mem2.c 2ba377e2f7d57ec36238456eb44371ac40aa0e94 F src/mem2.c 20cfac1d521ec74a69eed599baa755f6e905a51f
F src/mutex.c 40e5ba09d56863895882a0204d93832e9960ea78 F src/mutex.c 40e5ba09d56863895882a0204d93832e9960ea78
F src/mutex.h 079fa6fe9da18ceb89e79012c010594c6672addb F src/mutex.h 079fa6fe9da18ceb89e79012c010594c6672addb
F src/mutex_os2.c d47e9bd495583dd31263d8fe55160a31eb600a3c F src/mutex_os2.c d47e9bd495583dd31263d8fe55160a31eb600a3c
@@ -151,7 +151,7 @@ F src/test_btree.c c1308ba0b88ab577fa56c9e493a09829dfcded9c
F src/test_config.c 1eb08650f60a5ea652b45fb30781aad2543dd47b F src/test_config.c 1eb08650f60a5ea652b45fb30781aad2543dd47b
F src/test_hexio.c 82916f918687502658f02533b519c38cb180db6d F src/test_hexio.c 82916f918687502658f02533b519c38cb180db6d
F src/test_loadext.c 22065d601a18878e5542191001f0eaa5d77c0ed8 F src/test_loadext.c 22065d601a18878e5542191001f0eaa5d77c0ed8
F src/test_malloc.c 9f26ba3469efc97f38100a899ca889d480778864 F src/test_malloc.c 35310c5147effb632fd52c1dd872ef82d56faee8
F src/test_md5.c 34599caee5b1c73dcf86ca31f55846fab8c19ef7 F src/test_md5.c 34599caee5b1c73dcf86ca31f55846fab8c19ef7
F src/test_schema.c 12c9de7661d6294eec2d57afbb52e2af1128084f F src/test_schema.c 12c9de7661d6294eec2d57afbb52e2af1128084f
F src/test_server.c 1020673fc02ba5bbfa5dc96ded9f54f0f3744d38 F src/test_server.c 1020673fc02ba5bbfa5dc96ded9f54f0f3744d38
@@ -568,7 +568,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 71ab92e900512ad01047b46f734bd5f65998ecf9 P 23746924db3c005d1f75572c6cbb91db6fc41eb4
R c0dc5aea978543f645c277d88cedcb03 R 80f8d106415c810b911e5727899048d8
U danielk1977 U danielk1977
Z ac30c668c1547b4e8dacce191621ac0d Z d2507462ebb24d1bb162827dff859cd2

View File

@@ -1 +1 @@
23746924db3c005d1f75572c6cbb91db6fc41eb4 49ce3a838194f0316c883dbe1596d13c0c0fad1b

View File

@@ -12,7 +12,7 @@
** This file contains the C functions that implement a memory ** This file contains the C functions that implement a memory
** allocation subsystem for use by SQLite. ** allocation subsystem for use by SQLite.
** **
** $Id: mem2.c,v 1.11 2007/08/29 12:31:26 danielk1977 Exp $ ** $Id: mem2.c,v 1.12 2007/08/30 15:46:07 danielk1977 Exp $
*/ */
/* /*
@@ -497,6 +497,10 @@ int sqlite3_memdebug_fail(int iFail, int iRepeat, int *piBenign){
return n; return n;
} }
int sqlite3_memdebug_pending(){
return (mem.iFail-1);
}
void sqlite3MallocBenignFailure(int isBenign){ void sqlite3MallocBenignFailure(int isBenign){
if( isBenign ){ if( isBenign ){
mem.iNextIsBenign = 1; mem.iNextIsBenign = 1;

View File

@@ -13,7 +13,7 @@
** This file contains code used to implement test interfaces to the ** This file contains code used to implement test interfaces to the
** memory allocation subsystem. ** memory allocation subsystem.
** **
** $Id: test_malloc.c,v 1.6 2007/08/29 12:31:28 danielk1977 Exp $ ** $Id: test_malloc.c,v 1.7 2007/08/30 15:46:07 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@@ -324,6 +324,33 @@ static int test_memdebug_fail(
return TCL_OK; return TCL_OK;
} }
/*
** Usage: sqlite3_memdebug_pending
**
** Return the number of malloc() calls that will succeed before a
** simulated failure occurs. A negative return value indicates that
** no malloc() failure is scheduled.
*/
static int test_memdebug_pending(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
#ifdef SQLITE_MEMDEBUG
{
extern int sqlite3_memdebug_pending();
Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_memdebug_pending()));
}
#endif
return TCL_OK;
}
/* /*
** Usage: sqlite3_memdebug_settitle TITLE ** Usage: sqlite3_memdebug_settitle TITLE
@@ -373,6 +400,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){
{ "sqlite3_memdebug_backtrace", test_memdebug_backtrace }, { "sqlite3_memdebug_backtrace", test_memdebug_backtrace },
{ "sqlite3_memdebug_dump", test_memdebug_dump }, { "sqlite3_memdebug_dump", test_memdebug_dump },
{ "sqlite3_memdebug_fail", test_memdebug_fail }, { "sqlite3_memdebug_fail", test_memdebug_fail },
{ "sqlite3_memdebug_pending", test_memdebug_pending },
{ "sqlite3_memdebug_settitle", test_memdebug_settitle }, { "sqlite3_memdebug_settitle", test_memdebug_settitle },
}; };
int i; int i;