/ Check-in [555dad90]
Login

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

Overview
Comment:Disable some very expensive asserts in pcache.c that are too slow for all.test. (CVS 5616)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:555dad900fad874099556d44c464ea9f64687ca0
User & Date: danielk1977 2008-08-26 19:08:00
Context
2008-08-26
21:07
All the page_size pragma to change the page size on a new :memory: database, but not a vacuumed :memory: database. Ticket #3335 (CVS 5617) check-in: 226a9056 user: drh tags: trunk
19:08
Disable some very expensive asserts in pcache.c that are too slow for all.test. (CVS 5616) check-in: 555dad90 user: danielk1977 tags: trunk
18:05
Simplify the pcache module by only recycling clean pages from 'other' caches. This commit causes errors in test files ioerr5.test and malloc5.test because they test recycling dirty pages from other caches. (CVS 5615) check-in: 9e511e16 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file implements that page cache.
    13     13   **
    14         -** @(#) $Id: pcache.c,v 1.14 2008/08/26 18:05:48 danielk1977 Exp $
           14  +** @(#) $Id: pcache.c,v 1.15 2008/08/26 19:08:00 danielk1977 Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** A complete page cache is an instance of this structure.
    20     20   */
    21     21   struct PCache {
................................................................................
    96     96   #ifndef NDEBUG
    97     97   /*
    98     98   ** This routine verifies that the number of entries in the hash table
    99     99   ** is pCache->nPage.  This routine is used within assert() statements
   100    100   ** only and is therefore disabled during production builds.
   101    101   */
   102    102   static int pcacheCheckHashCount(PCache *pCache){
          103  +#if 0
   103    104     int i;
   104    105     int nPage = 0;
   105    106     for(i=0; i<pCache->nHash; i++){
   106    107       PgHdr *p;
   107    108       for(p=pCache->apHash[i]; p; p=p->pNextHash){
   108    109         nPage++;
   109    110       }
   110    111     }
   111    112     assert( nPage==pCache->nPage );
          113  +#endif
   112    114     return 1;
   113    115   }
   114    116   
   115    117   /*
   116    118   ** Based on the current value of PCache.nRef and the contents of the
   117    119   ** PCache.pDirty list, return the expected value of the PCache.nPinned
   118    120   ** counter. This is only used in debugging builds, as follows:
   119    121   **
   120    122   **   assert( pCache->nPinned==pcachePinnedCount(pCache) );
   121    123   */
   122    124   static int pcachePinnedCount(PCache *pCache){
          125  +#if 0
   123    126     PgHdr *p;
   124    127     int nPinned = pCache->nRef;
   125    128     for(p=pCache->pDirty; p; p=p->pNext){
   126    129       if( p->nRef==0 ){
   127    130         nPinned++;
   128    131       }
   129    132     }
   130    133     return nPinned;
          134  +#endif
          135  +  return pCache->nPinned;
   131    136   }
   132    137   
   133    138   /*
   134    139   ** Check that the pCache->pSynced variable is set correctly. If it
   135    140   ** is not, either fail an assert or return zero. Otherwise, return
   136    141   ** non-zero. This is only used in debugging builds, as follows:
   137    142   **
   138    143   **   assert( pcacheCheckSynced(pCache) );
   139    144   */
   140    145   static int pcacheCheckSynced(PCache *pCache){
          146  +#if 0
   141    147     PgHdr *p = pCache->pDirtyTail;
   142    148     for(p=pCache->pDirtyTail; p!=pCache->pSynced; p=p->pPrev){
   143    149       assert( p->nRef || (p->flags&PGHDR_NEED_SYNC) );
   144    150     }
   145    151     return (p==0 || p->nRef || (p->flags&PGHDR_NEED_SYNC)==0);
          152  +#endif
          153  +  return 1;
   146    154   }
   147    155   
   148    156   #endif
   149    157   
   150    158   /*
   151    159   ** Remove a page from its hash table (PCache.apHash[]).
   152    160   */