Further reforms to Tcl_*Alloc() usage.

FossilOrigin-Name: ee1e689633e517ce46307b9afbf1eda03482c928
This commit is contained in:
mistachkin 2017-02-15 04:16:56 +00:00
parent dd22c09af8
commit d742367ab5
4 changed files with 10 additions and 14 deletions

View File

@ -1,5 +1,5 @@
C In\sthe\sblob\stest\scode,\savoid\scrashing\son\slow-memory\ssystems\sby\susing\sTcl_AttemptAlloc().
D 2017-02-15T01:39:28.000
C Further\sreforms\sto\sTcl_*Alloc()\susage.
D 2017-02-15T04:16:56.208
F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 067a6766f800cc8d72845ab61f8de4ffe8f3fc99
@ -403,13 +403,13 @@ F src/sqliteInt.h c3f878dcbe947938f9e0984644f1902dd9051094
F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
F src/tclsqlite.c 418f5e5e0840425a7e5b33f3600dccd378a57549
F src/tclsqlite.c 6c2151b6d8d98e183a04466d40df8889c0574d79
F src/test1.c 8a98191a1da8e100f77cdb5cc716df67d405028d
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
F src/test3.c d03f5b5da9a2410b7a91c64b0d3306ed28ab6fee
F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d
F src/test6.c 55aa2775c154415dcf4ed7cd1e19a193122b3a02
F src/test6.c 121060d2e79a4f5047eb12b5135b23a6a7a5af01
F src/test7.c 5612e9aecf934d6df7bba6ce861fdf5ba5456010
F src/test8.c 4f4904721167b32f7a4fa8c7b32a07a673d6cc86
F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5
@ -1555,7 +1555,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P ca4f1e4962df64ae756c286f3795af7d6f692cdd
R 91e8830a4e86062346b40a8d7a630a58
P 1d267757a89d9267ee9c201373f801eb9772ab04
R f321de2fcbd363565a0432a788265485
U mistachkin
Z 631cc99fc676ac52e315c4b1825161e1
Z c20a15243be58007e25bc4aac5180d1c

View File

@ -1 +1 @@
1d267757a89d9267ee9c201373f801eb9772ab04
ee1e689633e517ce46307b9afbf1eda03482c928

View File

@ -3405,10 +3405,6 @@ static int SQLITE_TCLAPI DbMain(
}
zErrMsg = 0;
p = (SqliteDb*)Tcl_Alloc( sizeof(*p) );
if( p==0 ){
Tcl_SetResult(interp, (char *)"malloc failed", TCL_STATIC);
return TCL_ERROR;
}
memset(p, 0, sizeof(*p));
zFile = Tcl_GetStringFromObj(objv[2], 0);
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);

View File

@ -161,13 +161,13 @@ static CrashGlobal g = {0, 0, SQLITE_DEFAULT_SECTOR_SIZE, 0, 0};
static int sqlite3CrashTestEnable = 0;
static void *crash_malloc(int nByte){
return (void *)Tcl_Alloc((size_t)nByte);
return (void *)Tcl_AttemptAlloc((size_t)nByte);
}
static void crash_free(void *p){
Tcl_Free(p);
}
static void *crash_realloc(void *p, int n){
return (void *)Tcl_Realloc(p, (size_t)n);
return (void *)Tcl_AttemptRealloc(p, (size_t)n);
}
/*