diff options
author | drh <drh@noemail.net> | 2007-08-22 00:39:19 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-08-22 00:39:19 +0000 |
commit | 86f8c197ddd6972a1bd37cdfcca01a19c7c1aada (patch) | |
tree | 4d049d45dae245f2d0a168035a6acd2419210d4a /src/mutex.c | |
parent | 32bc3f6e01750d6b730efd372952156d7d62b066 (diff) | |
download | sqlite-86f8c197ddd6972a1bd37cdfcca01a19c7c1aada.tar.gz sqlite-86f8c197ddd6972a1bd37cdfcca01a19c7c1aada.zip |
Reenable the memory management logic. The quick.test script now runs with
SQLITE_MEMDEBUG and SQLITE_ENABLE_MEMORY_MANAGEMENT. 7 minor errors. (CVS 4265)
FossilOrigin-Name: 1914044b8832041f13b20ead613bd13725425d7a
Diffstat (limited to 'src/mutex.c')
-rw-r--r-- | src/mutex.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mutex.c b/src/mutex.c index db2e33ed0..4e52935c6 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -12,7 +12,7 @@ ** This file contains the C functions that implement mutexes for ** use by the SQLite core. ** -** $Id: mutex.c,v 1.6 2007/08/21 10:44:16 drh Exp $ +** $Id: mutex.c,v 1.7 2007/08/22 00:39:20 drh Exp $ */ /* ** If SQLITE_MUTEX_APPDEF is defined, then this whole module is @@ -126,7 +126,7 @@ struct sqlite3_mutex { ** that means that a mutex could not be allocated. */ sqlite3_mutex *sqlite3_mutex_alloc(int id){ - static sqlite3_mutex aStatic[3]; + static sqlite3_mutex aStatic[4]; sqlite3_mutex *pNew = 0; switch( id ){ case SQLITE_MUTEX_FAST: @@ -139,6 +139,8 @@ sqlite3_mutex *sqlite3_mutex_alloc(int id){ break; } default: { + assert( id-SQLITE_MUTEX_STATIC_MASTER >= 0 ); + assert( id-SQLITE_MUTEX_STATIC_MASTER < count(aStatic) ); pNew = &aStatic[id-SQLITE_MUTEX_STATIC_MASTER]; pNew->id = id; break; @@ -269,6 +271,7 @@ sqlite3_mutex *sqlite3_mutex_alloc(int iType){ { PTHREAD_MUTEX_INITIALIZER, }, { PTHREAD_MUTEX_INITIALIZER, }, { PTHREAD_MUTEX_INITIALIZER, }, + { PTHREAD_MUTEX_INITIALIZER, }, }; sqlite3_mutex *p; switch( iType ){ @@ -291,6 +294,8 @@ sqlite3_mutex *sqlite3_mutex_alloc(int iType){ break; } default: { + assert( iType-2 >= 0 ); + assert( iType-2 < count(staticMutexes) ); p = &staticMutexes[iType-2]; p->id = iType; break; |