diff options
author | drh <drh@noemail.net> | 2020-01-02 22:28:47 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-01-02 22:28:47 +0000 |
commit | 24d35e409c900adba4f5528e70c6c7e5e748cfd0 (patch) | |
tree | ebf7659473500f6e926d5db02e84f45081ac7fb7 /src/status.c | |
parent | 0c4f82051c7ff301ea78cf1d279005d2dc26ad19 (diff) | |
parent | 9fc1b9af36e54c7863a9404a9611abfb4b682374 (diff) | |
download | sqlite-24d35e409c900adba4f5528e70c6c7e5e748cfd0.tar.gz sqlite-24d35e409c900adba4f5528e70c6c7e5e748cfd0.zip |
Add the two-size lookaside memory allocator. Also, reduce the per-entry
size of the ExprList object.
FossilOrigin-Name: 51665bf0f975fb248964a4be205a4f3285d3f3f8cc697977d264efefbbe20dd8
Diffstat (limited to 'src/status.c')
-rw-r--r-- | src/status.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c index a5a39f4c1..c42bcc285 100644 --- a/src/status.c +++ b/src/status.c @@ -188,6 +188,10 @@ static u32 countLookasideSlots(LookasideSlot *p){ int sqlite3LookasideUsed(sqlite3 *db, int *pHighwater){ u32 nInit = countLookasideSlots(db->lookaside.pInit); u32 nFree = countLookasideSlots(db->lookaside.pFree); +#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE + nInit += countLookasideSlots(db->lookaside.pSmallInit); + nFree += countLookasideSlots(db->lookaside.pSmallFree); +#endif /* SQLITE_OMIT_TWOSIZE_LOOKASIDE */ if( pHighwater ) *pHighwater = db->lookaside.nSlot - nInit; return db->lookaside.nSlot - (nInit+nFree); } @@ -220,6 +224,15 @@ int sqlite3_db_status( db->lookaside.pInit = db->lookaside.pFree; db->lookaside.pFree = 0; } +#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE + p = db->lookaside.pSmallFree; + if( p ){ + while( p->pNext ) p = p->pNext; + p->pNext = db->lookaside.pSmallInit; + db->lookaside.pSmallInit = db->lookaside.pSmallFree; + db->lookaside.pSmallFree = 0; + } +#endif } break; } |