SQLite

Check-in [85f3d80eb7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:sqlite3PCachePerecentDirty() should return 0 if the pcache is empty.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tempfiles-25
Files: files | file ages | folders
SHA1: 85f3d80eb7319754792eef76996b2c740a2b0073
User & Date: drh 2016-04-18 13:30:50.144
Context
2016-04-18
13:36
Merge recent trunk changes. (check-in: d9768de502 user: drh tags: tempfiles-25)
13:30
sqlite3PCachePerecentDirty() should return 0 if the pcache is empty. (check-in: 85f3d80eb7 user: drh tags: tempfiles-25)
2016-04-13
19:20
Merge enhancements from trunk via tempfiles-lazy-open. (check-in: ae16310c4e user: drh tags: tempfiles-25)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pcache.c.
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
** of the configured cache size.
*/
int sqlite3PCachePercentDirty(PCache *pCache){
  PgHdr *pDirty;
  int nDirty = 0;
  int nCache = numberOfCachePages(pCache);
  for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++;
  return (int)(((i64)nDirty * 100) / nCache);
}

#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)
/*
** For all dirty pages currently in the cache, invoke the specified
** callback. This is only used if the SQLITE_CHECK_PAGES macro is
** defined.







|







691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
** of the configured cache size.
*/
int sqlite3PCachePercentDirty(PCache *pCache){
  PgHdr *pDirty;
  int nDirty = 0;
  int nCache = numberOfCachePages(pCache);
  for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++;
  return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
}

#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)
/*
** For all dirty pages currently in the cache, invoke the specified
** callback. This is only used if the SQLITE_CHECK_PAGES macro is
** defined.