From: dan Date: Mon, 9 Aug 2010 14:47:50 +0000 (+0000) Subject: Change to tcl test infrastructure so that --malloctrace=1 works when sizeof(int)... X-Git-Tag: version-3.7.2~53^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec561a351a08fb842caa2e65f4a3b601f4446793;p=thirdparty%2Fsqlite.git Change to tcl test infrastructure so that --malloctrace=1 works when sizeof(int)!=sizeof(void*). FossilOrigin-Name: c3e771b3cf685f4237a2516ee7111849bf0ffb3f --- diff --git a/manifest b/manifest index 9a4fbe11aa..d49f525643 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\scausing\sthe\sreturn\scode\sof\san\sxSync\scall\sto\sbe\signored\sin\swal.c. -D 2010-08-09T07:51:41 +C Change\sto\stcl\stest\sinfrastructure\sso\sthat\s--malloctrace=1\sworks\swhen\ssizeof(int)!=sizeof(void*). +D 2010-08-09T14:47:50 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -200,7 +200,7 @@ F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 F src/test_journal.c 5ac89727cadbcc71954067b319eb40aff71dead2 F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e -F src/test_malloc.c 058e41dc853b1fa8ccd1083e9571018a74aeb3a7 +F src/test_malloc.c 09a88f0c111201dc4f8c20470aa1b5f611d59200 F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3 F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c @@ -843,7 +843,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 158a309737bd4cdc033cd504a6d0cc43c15b6e17 -R 79082b63de1369184eea76cab5557bfc +P f1b2b5f9c3a5561ea6108283ae08404106c3f8bc +R 0c13ff5ef493cf88f58734e32a21c9d6 U dan -Z 5fdda4c9d9e63d074670dd4c1c360d96 +Z 48ba547a168a1ffe5803ea79aa90257c diff --git a/manifest.uuid b/manifest.uuid index 45c1738165..9547915834 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f1b2b5f9c3a5561ea6108283ae08404106c3f8bc \ No newline at end of file +c3e771b3cf685f4237a2516ee7111849bf0ffb3f \ No newline at end of file diff --git a/src/test_malloc.c b/src/test_malloc.c index 3fa753b7e0..08642c9fec 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -728,7 +728,10 @@ static int test_memdebug_settitle( return TCL_OK; } -#define MALLOC_LOG_FRAMES 10 +#define MALLOC_LOG_FRAMES 10 +#define MALLOC_LOG_KEYINTS ( \ + 10 * ((sizeof(int)>=sizeof(void*)) ? 1 : sizeof(void*)/sizeof(int)) \ +) static Tcl_HashTable aMallocLog; static int mallocLogEnabled = 0; @@ -745,8 +748,8 @@ static void test_memdebug_callback(int nByte, int nFrame, void **aFrame){ Tcl_HashEntry *pEntry; int isNew; - int aKey[MALLOC_LOG_FRAMES]; - int nKey = sizeof(int)*MALLOC_LOG_FRAMES; + int aKey[MALLOC_LOG_KEYINTS]; + int nKey = sizeof(int)*MALLOC_LOG_KEYINTS; memset(aKey, 0, nKey); if( (sizeof(void*)*nFrame)=sizeof(void*)); for( pEntry=Tcl_FirstHashEntry(&aMallocLog, &search); @@ -836,13 +839,13 @@ static int test_memdebug_log( ){ Tcl_Obj *apElem[MALLOC_LOG_FRAMES+2]; MallocLog *pLog = (MallocLog *)Tcl_GetHashValue(pEntry); - int *aKey = (int *)Tcl_GetHashKey(&aMallocLog, pEntry); + Tcl_WideInt *aKey = (Tcl_WideInt *)Tcl_GetHashKey(&aMallocLog, pEntry); int ii; apElem[0] = Tcl_NewIntObj(pLog->nCall); apElem[1] = Tcl_NewIntObj(pLog->nByte); for(ii=0; ii