aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-10-15 15:28:56 +0000
committerdrh <drh@noemail.net>2015-10-15 15:28:56 +0000
commitb02392e6f0a8980c261c1e46c1f7fbcfe54c23c2 (patch)
tree87d5fe7f11fa3e739b9c6087ca85f14ec0cd57a5 /src/malloc.c
parent9676c48199929fc7e748b2f688157ff8b6d72d1e (diff)
downloadsqlite-b02392e6f0a8980c261c1e46c1f7fbcfe54c23c2.tar.gz
sqlite-b02392e6f0a8980c261c1e46c1f7fbcfe54c23c2.zip
Change sqlite3StatusSet() into sqlite3StatusHighwater() so that only the
highwater mark is recorded. This gives a small size reduction and performance improvement. FossilOrigin-Name: 6422d223dd10018703c6b083d29a3c35c837fc97
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/malloc.c b/src/malloc.c
index f20eb6e79..f017e1bc0 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -224,7 +224,7 @@ static int mallocWithAlarm(int n, void **pp){
void *p;
assert( sqlite3_mutex_held(mem0.mutex) );
nFull = sqlite3GlobalConfig.m.xRoundup(n);
- sqlite3StatusSet(SQLITE_STATUS_MALLOC_SIZE, n);
+ sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, n);
if( mem0.alarmThreshold>0 ){
sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
if( nUsed >= mem0.alarmThreshold - nFull ){
@@ -316,7 +316,7 @@ void *sqlite3ScratchMalloc(int n){
assert( n>0 );
sqlite3_mutex_enter(mem0.mutex);
- sqlite3StatusSet(SQLITE_STATUS_SCRATCH_SIZE, n);
+ sqlite3StatusHighwater(SQLITE_STATUS_SCRATCH_SIZE, n);
if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
p = mem0.pScratchFree;
mem0.pScratchFree = mem0.pScratchFree->pNext;
@@ -518,7 +518,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
pNew = pOld;
}else if( sqlite3GlobalConfig.bMemstat ){
sqlite3_mutex_enter(mem0.mutex);
- sqlite3StatusSet(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
+ sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
nDiff = nNew - nOld;
if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
mem0.alarmThreshold-nDiff ){