Home | History | Annotate | Download | only in dist

Lines Matching refs:hdr

17156 ** free.  The first block has format u.hdr.  u.hdr.size4x is 4 times the
17158 ** The u.hdr.size4x&1 bit is true if the chunk is checked out and
17159 ** false if the chunk is on the freelist. The u.hdr.size4x&2 bit
17161 ** previous chunk is free. The u.hdr.prevSize field is the size of
17164 ** u.hdr.prevSize can be part of the data for that chunk and should
17180 ** the u.hdr.prevSize value of the following chunk.
17188 } hdr;
17272 assert( (mem3.aPool[i-1].u.hdr.size4x & 1)==0 );
17274 size = mem3.aPool[i-1].u.hdr.size4x/4;
17275 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
17307 assert( (mem3.aPool[i-1].u.hdr.size4x & 1)==0 );
17308 size = mem3.aPool[i-1].u.hdr.size4x/4;
17309 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
17358 assert( mem3.aPool[i-1].u.hdr.size4x/4==nBlock );
17359 assert( mem3.aPool[i+nBlock-1].u.hdr.prevSize==nBlock );
17360 x = mem3.aPool[i-1].u.hdr.size4x;
17361 mem3.aPool[i-1].u.hdr.size4x = nBlock*4 | 1 | (x&2);
17362 mem3.aPool[i+nBlock-1].u.hdr.prevSize = nBlock;
17363 mem3.aPool[i+nBlock-1].u.hdr.size4x |= 2;
17387 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = nBlock;
17388 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x |= 2;
17389 mem3.aPool[newi-1].u.hdr.size4x = nBlock*4 + 1;
17391 mem3.aPool[newi-1].u.hdr.prevSize = mem3.szMaster;
17392 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
17393 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
17423 size = mem3.aPool[i-1].u.hdr.size4x;
17427 assert( i > mem3.aPool[i-1].u.hdr.prevSize );
17428 prev = i - mem3.aPool[i-1].u.hdr.prevSize;
17434 x = mem3.aPool[prev-1].u.hdr.size4x & 2;
17435 mem3.aPool[prev-1].u.hdr.size4x = size*4 | x;
17436 mem3.aPool[prev+size-1].u.hdr.prevSize = size;
17484 if( mem3.aPool[i-1].u.hdr.size4x/4==nBlock ){
17545 assert( (mem3.aPool[i-1].u.hdr.size4x&1)==1 );
17546 size = mem3.aPool[i-1].u.hdr.size4x/4;
17548 mem3.aPool[i-1].u.hdr.size4x &= ~1;
17549 mem3.aPool[i+size-1].u.hdr.prevSize = size;
17550 mem3.aPool[i+size-1].u.hdr.size4x &= ~2;
17555 while( (mem3.aPool[mem3.iMaster-1].u.hdr.size4x&2)==0 ){
17556 size = mem3.aPool[mem3.iMaster-1].u.hdr.prevSize;
17560 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
17561 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
17562 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = mem3.szMaster;
17564 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
17565 while( (mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x&1)==0 ){
17567 mem3.szMaster += mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x/4;
17568 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
17569 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = mem3.szMaster;
17583 assert( (pBlock[-1].u.hdr.size4x&1)!=0 );
17584 return (pBlock[-1].u.hdr.size4x&~3)*2 - 4;
17669 mem3.aPool[0].u.hdr.size4x = (mem3.szMaster<<2) + 2;
17670 mem3.aPool[mem3.nPool].u.hdr.prevSize = mem3.nPool;
17671 mem3.aPool[mem3.nPool].u.hdr.size4x = 1;
17709 size = mem3.aPool[i-1].u.hdr.size4x;
17715 if( (size&1)==0 && mem3.aPool[i+size/4-1].u.hdr.prevSize!=size/4 ){
17720 if( ((mem3.aPool[i+size/4-1].u.hdr.size4x&2)>>1)!=(size&1) ){
17737 (mem3.aPool[j-1].u.hdr.size4x/4)*8-8);
17746 (mem3.aPool[j-1].u.hdr.size4x/4)*8-8);
47930 WalIndexHdr hdr; /* Wal-index header for current transaction */
48139 ** Write the header information in pWal->hdr into the wal-index.
48141 ** The checksum on pWal->hdr is updated before it is written.
48148 pWal->hdr.isInit = 1;
48149 pWal->hdr.iVersion = WALINDEX_MAX_VERSION;
48150 walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum);
48151 memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
48153 memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
48177 u32 *aCksum = pWal->hdr.aFrameCksum;
48181 memcpy(&aFrame[8], pWal->hdr.aSalt, 8);
48183 nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
48204 u32 *aCksum = pWal->hdr.aFrameCksum;
48211 if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){
48227 nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
48399 ** than pWal->hdr.mxFrame.
48401 ** This function is called whenever pWal->hdr.mxFrame is decreased due
48404 ** At most only the hash table containing pWal->hdr.mxFrame needs to be
48406 ** pWal->hdr.mxFrame advances to the point where those hash tables are
48418 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE-1 );
48419 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE );
48420 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE+1 );
48422 if( pWal->hdr.mxFrame==0 ) return;
48425 ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed
48428 assert( pWal->nWiData>walFramePage(pWal->hdr.mxFrame) );
48429 assert( pWal->apWiData[walFramePage(pWal->hdr.mxFrame)] );
48430 walHashGet(pWal, walFramePage(pWal->hdr.mxFrame), &aHash, &aPgno, &iZero);
48433 ** than pWal->hdr.mxFrame.
48435 iLimit = pWal->hdr.mxFrame - iZero;
48444 ** frame numbers greater than pWal->hdr.mxFrame.
48585 memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
48624 pWal->hdr.bigEndCksum = (u8)(magic&0x00000001);
48627 memcpy(&pWal->hdr.aSalt, &aBuf[16], 8);
48630 walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN,
48631 aBuf, WAL_HDRSIZE-2*4, 0, pWal->hdr.aFrameCksum
48633 if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24])
48634 || pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28])
48673 pWal->hdr.mxFrame = iFrame;
48674 pWal->hdr.nPage = nTruncate;
48675 pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16));
48678 aFrameCksum[0] = pWal->hdr.aFrameCksum[0];
48679 aFrameCksum[1] = pWal->hdr.aFrameCksum[1];
48690 pWal->hdr.aFrameCksum[0] = aFrameCksum[0];
48691 pWal->hdr.aFrameCksum[1] = aFrameCksum[1];
48702 if( pWal->hdr.mxFrame ) pInfo->aReadMark[1] = pWal->hdr.mxFrame;
48709 if( pWal->hdr.nPage ){
48712 pWal->hdr.mxFrame, pWal->zWalName
49034 assert( pWal->ckptLock && pWal->hdr.mxFrame>0 );
49035 iLast = pWal->hdr.mxFrame;
49123 return (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
49180 if( pInfo->nBackfill>=pWal->hdr.mxFrame ) return SQLITE_OK;
49196 mxSafeFrame = pWal->hdr.mxFrame;
49197 mxPage = pWal->hdr.nPage;
49201 assert( y<=pWal->hdr.mxFrame );
49256 i64 szDb = pWal->hdr.nPage*(i64)szPage;
49285 if( pInfo->nBackfill<pWal->hdr.mxFrame ){
49288 assert( mxSafeFrame==pWal->hdr.mxFrame );
49395 ** pWal->hdr, then pWal->hdr is updated to the content of the new header
49435 if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){
49437 memcpy(&pWal->hdr, &h1, sizeof(WalIndexHdr));
49438 pWal->szPage = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
49448 ** Read the wal-index header from the wal-index and into pWal->hdr.
49452 ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
49453 ** changed by this opertion. If pWal->hdr is unchanged, set *pChanged
49513 if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){
49538 ** to make a copy of the wal-index header into pWal->hdr. If the
49561 ** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0
49645 if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame ){
49652 if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){
49679 ** but not exceeding pWal->hdr.mxFrame and lock that entry.
49685 if( mxReadMark<=thisMark && thisMark<=pWal->hdr.mxFrame ){
49694 && (mxReadMark<pWal->hdr.mxFrame || mxI==0)
49699 mxReadMark = pInfo->aReadMark[i] = pWal->hdr.mxFrame;
49725 ** that occur later in the log than pWal->hdr.mxFrame may have been
49728 ** pWal->hdr.mxFrame risks reading a corrupted snapshot. So, retry
49739 || memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr))
49744 assert( mxReadMark<=pWal->hdr.mxFrame );
49805 u32 iLast = pWal->hdr.mxFrame; /* Last page in WAL for this reader */
49906 sz = pWal->hdr.szPage;
49920 return pWal->hdr.nPage;
49963 if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){
50000 Pgno iMax = pWal->hdr.mxFrame;
50006 memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr));
50008 for(iFrame=pWal->hdr.mxFrame+1;
50026 if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal);
50040 aWalData[0] = pWal->hdr.mxFrame;
50041 aWalData[1] = pWal->hdr.aFrameCksum[0];
50042 aWalData[2] = pWal->hdr.aFrameCksum[1];
50056 assert( aWalData[3]!=pWal->nCkpt || aWalData[0]<=pWal->hdr.mxFrame );
50067 if( aWalData[0]<pWal->hdr.mxFrame ){
50068 pWal->hdr.mxFrame = aWalData[0];
50069 pWal->hdr.aFrameCksum[0] = aWalData[1];
50070 pWal->hdr.aFrameCksum[1] = aWalData[2];
50083 ** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left
50087 ** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
50096 assert( pInfo->nBackfill==pWal->hdr.mxFrame );
50113 u32 *aSalt = pWal->hdr.aSalt; /* Big-endian salt values */
50116 pWal->hdr.mxFrame = 0;
50243 pWal, cnt, pWal->hdr.mxFrame, isCommit ? "Commit" : "Spill"));
50248 ** log file, instead of appending to it at pWal->hdr.mxFrame.
50258 iFrame = pWal->hdr.mxFrame;
50267 if( pWal->nCkpt==0 ) sqlite3_randomness(8, pWal->hdr.aSalt);
50268 memcpy(&aWalHdr[16], pWal->hdr.aSalt, 8);
50274 pWal->hdr.bigEndCksum = SQLITE_BIGENDIAN;
50275 pWal->hdr.aFrameCksum[0] = aCksum[0];
50276 pWal->hdr.aFrameCksum[1] = aCksum[1];
50367 iFrame = pWal->hdr.mxFrame;
50380 pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16));
50383 pWal->hdr.mxFrame = iFrame;
50385 pWal->hdr.iChange++;
50386 pWal->hdr.nPage = nTruncate;
50467 if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){
50475 if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame;
50487 memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
52669 int hdr; /* Offset to the page header */
52688 hdr = pPage->hdrOffset;
52691 assert( nCell==get2byte(&data[hdr+3]) );
52693 cbrk = get2byte(&data[hdr+5]);
52731 put2byte(&data[hdr+5], cbrk);
52732 data[hdr+1] = 0;
52733 data[hdr+2] = 0;
52734 data[hdr+7] = 0;
52757 const int hdr = pPage->hdrOffset; /* Local cache of pPage->hdrOffset */
52774 nFrag = data[hdr+7];
52775 assert( pPage->cellOffset == hdr + 12 - 4*pPage->leaf );
52777 top = get2byteNotZero(&data[hdr+5]);
52787 top = get2byteNotZero(&data[hdr+5]);
52794 for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){
52808 data[hdr+7] = (u8)(nFrag + x);
52829 top = get2byteNotZero(&data[hdr+5]);
52841 put2byte(&data[hdr+5], top);
52856 int addr, pbegin, hdr;
52882 hdr = pPage->hdrOffset;
52883 addr = hdr + 1;
52902 addr = hdr + 1;
52911 if( (frag<0) || (frag>(int)data[hdr+7]) ){
52914 data[hdr+7] -= (u8)frag;
52925 if( data[hdr+1]==data[hdr+5] && data[hdr+2]==data[hdr+6] ){
52927 pbegin = get2byte(&data[hdr+1]);
52928 memcpy(&data[hdr+1], &data[pbegin], 2);
52929 top = get2byte(&data[hdr+5]) + get2byte(&data[pbegin+2]);
52930 put2byte(&data[hdr+5], top);
52993 u8 hdr; /* Offset to beginning of page header */
53005 hdr = pPage->hdrOffset;
53007 if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT;
53012 pPage->cellOffset = cellOffset = hdr + 12 - 4*pPage->leaf;
53015 top = get2byteNotZero(&data[hdr+5]);
53016 pPage->nCell = get2byte(&data[hdr+3]);
53056 pc = get2byte(&data[hdr+1]);
53057 nFree = data[hdr+7] + top;
53098 u8 hdr = pPage->hdrOffset;
53107 memset(&data[hdr], 0, pBt->usableSize - hdr);
53109 data[hdr] = (char)flags;
53110 first = hdr + ((flags&PTF_LEAF)==0 ? 12 : 8);
53111 memset(&data[hdr+1], 0, 4);
53112 data[hdr+7] = 0;
53113 put2byte(&data[hdr+5], pBt->usableSize);
53960 int nPageHeader; /* Number of pages in the database according to hdr */
57237 int hdr; /* Beginning of the header. 0 most pages. 100 page 1 */
57248 hdr = pPage->hdrOffset;
57249 testcase( pc==get2byte(&data[hdr+5]) );
57251 if( pc < (u32)get2byte(&data[hdr+5]) || pc+sz > pPage->pBt->usableSize ){
57262 put2byte(&data[hdr+3], pPage->nCell);
57377 const int hdr = pPage->hdrOffset; /* Offset of header on pPage */
57388 assert( get2byteNotZero(&data[hdr+5])==nUsable );
57399 put2byte(&data[hdr+3], nCell);
57400 put2byte(&data[hdr+5], cellbody);
58953 int hdr;
58962 hdr = pPage->hdrOffset;
58973 rc = clearDatabasePage(pBt, get4byte(&pPage->aData[hdr+8]), 1, pnChange);
58982 zeroPage(pPage, pPage->aData[hdr] | PTF_LEAF);
59511 int hdr, cellStart;
59654 hdr = pPage->hdrOffset;
59659 int contentOffset = get2byteNotZero(&data[hdr+5]);
59663 nCell = get2byte(&data[hdr+3]);
59664 cellStart = hdr + 12 - 4*pPage->leaf;
59679 i = get2byte(&data[hdr+1]);
59700 if( cnt!=data[hdr+7] ){
59703 cnt, data[hdr+7], iPage);
70646 ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 |
70654 ** hdr-size field is also a varint which is the offset from the beginning