mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user