/ Check-in [340b3477]
Login

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

Overview
Comment:Make SQLITE_CONFIG_PCACHE_HDRSZ accurate (not an over-estimate) on 32-bit systems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 340b347758e570db3e739b56af0dcf3fc34525be
User & Date: drh 2014-12-30 13:04:25
Context
2014-12-30
14:40
If the sorter uses mmap'd temp files, ensure all pages of the temp file have been allocated before it is accessed. Otherwise, a disk-full condition might result in a SIGBUS exception. check-in: 77664841 user: dan tags: trunk
13:04
Make SQLITE_CONFIG_PCACHE_HDRSZ accurate (not an over-estimate) on 32-bit systems. check-in: 340b3477 user: drh tags: trunk
12:03
Change notify2.test to check that sqlite3_blocking_step() uses CPU more efficiently than sqlite3_step(), not that it results in greater overall throughput for any specific number of threads. check-in: d904d293 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache.c.

   192    192   ** are no outstanding page references when this function is called.
   193    193   */
   194    194   int sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
   195    195     assert( pCache->nRef==0 && pCache->pDirty==0 );
   196    196     if( pCache->szPage ){
   197    197       sqlite3_pcache *pNew;
   198    198       pNew = sqlite3GlobalConfig.pcache2.xCreate(
   199         -                szPage, pCache->szExtra + sizeof(PgHdr), pCache->bPurgeable
          199  +                szPage, pCache->szExtra + ROUND8(sizeof(PgHdr)),
          200  +                pCache->bPurgeable
   200    201       );
   201    202       if( pNew==0 ) return SQLITE_NOMEM;
   202    203       sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
   203    204       if( pCache->pCache ){
   204    205         sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache);
   205    206       }
   206    207       pCache->pCache = pNew;

Changes to src/pcache1.c.

   292    292     p = sqlite3Malloc(sizeof(PgHdr1) + pCache->szExtra);
   293    293     if( !pPg || !p ){
   294    294       pcache1Free(pPg);
   295    295       sqlite3_free(p);
   296    296       pPg = 0;
   297    297     }
   298    298   #else
   299         -  pPg = pcache1Alloc(sizeof(PgHdr1) + pCache->szPage + pCache->szExtra);
          299  +  pPg = pcache1Alloc(ROUND8(sizeof(PgHdr1)) + pCache->szPage + pCache->szExtra);
   300    300     p = (PgHdr1 *)&((u8 *)pPg)[pCache->szPage];
   301    301   #endif
   302    302     pcache1EnterMutex(pCache->pGroup);
   303    303   
   304    304     if( pPg ){
   305    305       p->page.pBuf = pPg;
   306    306       p->page.pExtra = &p[1];