1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Change sqlite3StatusSet() into sqlite3StatusHighwater() so that only the

highwater mark is recorded.  This gives a small size reduction and
performance improvement.

FossilOrigin-Name: 6422d223dd10018703c6b083d29a3c35c837fc97
This commit is contained in:
drh
2015-10-15 15:28:56 +00:00
parent 9676c48199
commit b02392e6f0
8 changed files with 30 additions and 26 deletions

View File

@@ -108,18 +108,21 @@ void sqlite3StatusDown(int op, int N){
}
/*
** Set the value of a status to X. The highwater mark is adjusted if
** necessary. The caller must hold the appropriate mutex.
** Adjust the highwater mark if necessary.
** The caller must hold the appropriate mutex.
*/
void sqlite3StatusSet(int op, int X){
void sqlite3StatusHighwater(int op, int X){
wsdStatInit;
assert( op>=0 && op<ArraySize(wsdStat.nowValue) );
assert( op>=0 && op<ArraySize(statMutex) );
assert( sqlite3_mutex_held(statMutex[op] ? sqlite3Pcache1Mutex()
: sqlite3MallocMutex()) );
wsdStat.nowValue[op] = X;
if( wsdStat.nowValue[op]>wsdStat.mxValue[op] ){
wsdStat.mxValue[op] = wsdStat.nowValue[op];
assert( op==SQLITE_STATUS_MALLOC_SIZE
|| op==SQLITE_STATUS_PAGECACHE_SIZE
|| op==SQLITE_STATUS_SCRATCH_SIZE
|| op==SQLITE_STATUS_PARSER_STACK );
if( X>wsdStat.mxValue[op] ){
wsdStat.mxValue[op] = X;
}
}