1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add the SQLITE_DBSTATUS_CACHE_SIZE verb for sqlite3_db_status(). The

highwater mark does not yet work on this verb.

FossilOrigin-Name: 418c6d8113bc337556b0d47acfd6a7d865d1121f
This commit is contained in:
drh
2010-03-10 21:42:07 +00:00
parent 9f8da32662
commit 63da089314
8 changed files with 105 additions and 17 deletions

View File

@@ -4854,6 +4854,16 @@ int sqlite3PagerRefcount(Pager *pPager){
return sqlite3PcacheRefCount(pPager->pPCache);
}
/*
** Return the approximate number of bytes of memory currently
** used by the pager and its associated cache.
*/
int sqlite3PagerMemUsed(Pager *pPager){
int perPageSize = pPager->pageSize + pPager->nExtra + 20;
return perPageSize*sqlite3PcachePagecount(pPager->pPCache)
+ sqlite3MallocSize(pPager);
}
/*
** Return the number of references to the specified page.
*/