1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-25 20:58:26 +03:00

Include the ThreadData structure in internal malloc() testing. Also fixes for revealed bugs. (CVS 2974)

FossilOrigin-Name: c7b9d50d0a975912776aaa2b870308652f77e1e6
This commit is contained in:
danielk1977
2006-01-18 18:22:43 +00:00
parent 757b04ed36
commit 76e8d1a292
10 changed files with 92 additions and 59 deletions

View File

@@ -1782,7 +1782,12 @@ ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
pTsd = pthread_getspecific(key);
if( allocateFlag>0 ){
if( pTsd==0 ){
pTsd = sqlite3OsMalloc(sizeof(zeroData));
if( !sqlite3TestMallocFail() ){
pTsd = sqlite3OsMalloc(sizeof(zeroData));
}
#ifdef SQLITE_MEMDEBUG
sqlite3_isFail = 0;
#endif
if( pTsd ){
*pTsd = zeroData;
pthread_setspecific(key, pTsd);
@@ -1801,7 +1806,12 @@ ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
static ThreadData *pTsd = 0;
if( allocateFlag>0 ){
if( pTsd==0 ){
pTsd = sqlite3OsMalloc( sizeof(zeroData) );
if( !sqlite3TestMallocFail() ){
pTsd = sqlite3OsMalloc( sizeof(zeroData) );
}
#ifdef SQLITE_MEMDEBUG
sqlite3_isFail = 0;
#endif
if( pTsd ){
*pTsd = zeroData;
TSD_COUNTER(+1);