SQLite

Check-in [7bcd3ab5f0]
Login

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

Overview
Comment:Memory leak associated with SQLITE_WRITE_WALFRAME_PREBUFFERED
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: 7bcd3ab5f0519cb9ac8f7b98827600b9eff8db85
User & Date: drh 2016-02-18 01:22:53.158
Context
2016-02-18
01:36
Merge recent performance enhancements and the enhanced API_ARMOR from trunk. (check-in: b7fa0fb339 user: drh tags: apple-osx)
01:22
Memory leak associated with SQLITE_WRITE_WALFRAME_PREBUFFERED (check-in: 7bcd3ab5f0 user: drh tags: apple-osx)
2016-02-15
17:40
Merge 3.11.0 changes. (check-in: 5cecc509d0 user: drh tags: apple-osx)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/wal.c.
3110
3111
3112
3113
3114
3115
3116
3117





3118
3119
3120
3121
3122
3123
3124
      }
    }

    iFrame++;
    assert( iOffset==walFrameOffset(iFrame, szPage) );
    nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0;
    rc = walWriteOneFrame(&w, p, nDbSize, iOffset);
    if( rc ) return rc;





    pLast = p;
    iOffset += szFrame;
    p->flags |= PGHDR_WAL_APPEND;
  }

  /* Recalculate checksums within the wal file if required. */
  if( isCommit && pWal->iReCksum ){







|
>
>
>
>
>







3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
      }
    }

    iFrame++;
    assert( iOffset==walFrameOffset(iFrame, szPage) );
    nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0;
    rc = walWriteOneFrame(&w, p, nDbSize, iOffset);
    if( rc ) {
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
      free(w.aFrameBuf);
#endif
      return rc;
    }
    pLast = p;
    iOffset += szFrame;
    p->flags |= PGHDR_WAL_APPEND;
  }

  /* Recalculate checksums within the wal file if required. */
  if( isCommit && pWal->iReCksum ){
3142
3143
3144
3145
3146
3147
3148
3149





3150
3151
3152
3153
3154
3155
3156
  */
  if( isCommit && (sync_flags & WAL_SYNC_TRANSACTIONS)!=0 ){
    if( pWal->padToSectorBoundary ){
      int sectorSize = sqlite3SectorSize(pWal->pWalFd);
      w.iSyncPoint = ((iOffset+sectorSize-1)/sectorSize)*sectorSize;
      while( iOffset<w.iSyncPoint ){
        rc = walWriteOneFrame(&w, pLast, nTruncate, iOffset);
        if( rc ) return rc;





        iOffset += szFrame;
        nExtra++;
      }
    }else{
      rc = sqlite3OsSync(w.pFd, sync_flags & SQLITE_SYNC_MASK);
    }
  }







|
>
>
>
>
>







3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
  */
  if( isCommit && (sync_flags & WAL_SYNC_TRANSACTIONS)!=0 ){
    if( pWal->padToSectorBoundary ){
      int sectorSize = sqlite3SectorSize(pWal->pWalFd);
      w.iSyncPoint = ((iOffset+sectorSize-1)/sectorSize)*sectorSize;
      while( iOffset<w.iSyncPoint ){
        rc = walWriteOneFrame(&w, pLast, nTruncate, iOffset);
        if( rc ) {
#if defined(SQLITE_WRITE_WALFRAME_PREBUFFERED)
          free(w.aFrameBuf);
#endif
          return rc;
        }
        iOffset += szFrame;
        nExtra++;
      }
    }else{
      rc = sqlite3OsSync(w.pFd, sync_flags & SQLITE_SYNC_MASK);
    }
  }