/ Check-in [899fa19d]
Login

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

Overview
Comment:Move an assert() in sqlite3PcacheDirtyPage() so that it does not occur before local variable declarations. Ticket #3325. (CVS 5575)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 899fa19d1ab9c40a2ffc1c5170476292d0509e33
User & Date: danielk1977 2008-08-21 04:41:02
Context
2008-08-21
12:19
Fix the functionality associated with sqlite3_release_memory() and sqlite3_soft_heap_limit(). It is automatically disabled if the SQLITE_CONFIG_PAGECACHE option is used. (CVS 5576) check-in: d025866b user: danielk1977 tags: trunk
04:41
Move an assert() in sqlite3PcacheDirtyPage() so that it does not occur before local variable declarations. Ticket #3325. (CVS 5575) check-in: 899fa19d user: danielk1977 tags: trunk
04:35
Remove leftover PGHDR_TO_DATA macro from pager.c. Ticket #3323. (CVS 5574) check-in: 5e9559c0 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.2 2008/08/20 21:47:46 drh Exp $
           14  +** @(#) $Id: pcache.c,v 1.3 2008/08/21 04:41:02 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 {
................................................................................
  1026   1026   ** pointer is set to 0 and a pointer to the page is returned. If no
  1027   1027   ** such page is found, 0 is returned.
  1028   1028   **
  1029   1029   ** This is used by the pager module to implement the xStress callback.
  1030   1030   */
  1031   1031   PgHdr *sqlite3PcacheDirtyPage(PCache *pCache){
  1032   1032     PgHdr *p = 0;
  1033         -  assert( pCache->iInUseMM );
  1034   1033   #if 1
  1035   1034     PgHdr *pIter;
  1036   1035     Pgno min_pgno;
  1037   1036     for(pIter=pCache->pDirty; pIter; pIter=pIter->pNext){
  1038   1037       if( pIter->nRef==0 && (p==0 || pIter->pgno<min_pgno) ){
  1039   1038         p = pIter;
  1040   1039         min_pgno = pIter->pgno;
  1041   1040       }
  1042   1041     }
  1043   1042   #else
  1044   1043     for(p=pCache->pDirty; p && p->nRef; p=p->pNext);
  1045   1044   #endif
         1045  +  assert( pCache->iInUseMM );
  1046   1046     if( p ){
  1047   1047       p->pDirty = 0;
  1048   1048     }
  1049   1049     return p;
  1050   1050   }
  1051   1051   
  1052   1052   /*