Home | History | Annotate | Download | only in dist

Lines Matching refs:hdr

16041 ** free.  The first block has format u.hdr.  u.hdr.size4x is 4 times the
16043 ** The u.hdr.size4x&1 bit is true if the chunk is checked out and
16044 ** false if the chunk is on the freelist. The u.hdr.size4x&2 bit
16046 ** previous chunk is free. The u.hdr.prevSize field is the size of
16049 ** u.hdr.prevSize can be part of the data for that chunk and should
16065 ** the u.hdr.prevSize value of the following chunk.
16073 } hdr;
16157 assert( (mem3.aPool[i-1].u.hdr.size4x & 1)==0 );
16159 size = mem3.aPool[i-1].u.hdr.size4x/4;
16160 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
16192 assert( (mem3.aPool[i-1].u.hdr.size4x & 1)==0 );
16193 size = mem3.aPool[i-1].u.hdr.size4x/4;
16194 assert( size==mem3.aPool[i+size-1].u.hdr.prevSize );
16243 assert( mem3.aPool[i-1].u.hdr.size4x/4==nBlock );
16244 assert( mem3.aPool[i+nBlock-1].u.hdr.prevSize==nBlock );
16245 x = mem3.aPool[i-1].u.hdr.size4x;
16246 mem3.aPool[i-1].u.hdr.size4x = nBlock*4 | 1 | (x&2);
16247 mem3.aPool[i+nBlock-1].u.hdr.prevSize = nBlock;
16248 mem3.aPool[i+nBlock-1].u.hdr.size4x |= 2;
16272 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = nBlock;
16273 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x |= 2;
16274 mem3.aPool[newi-1].u.hdr.size4x = nBlock*4 + 1;
16276 mem3.aPool[newi-1].u.hdr.prevSize = mem3.szMaster;
16277 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
16278 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
16308 size = mem3.aPool[i-1].u.hdr.size4x;
16312 assert( i > mem3.aPool[i-1].u.hdr.prevSize );
16313 prev = i - mem3.aPool[i-1].u.hdr.prevSize;
16319 x = mem3.aPool[prev-1].u.hdr.size4x & 2;
16320 mem3.aPool[prev-1].u.hdr.size4x = size*4 | x;
16321 mem3.aPool[prev+size-1].u.hdr.prevSize = size;
16369 if( mem3.aPool[i-1].u.hdr.size4x/4==nBlock ){
16430 assert( (mem3.aPool[i-1].u.hdr.size4x&1)==1 );
16431 size = mem3.aPool[i-1].u.hdr.size4x/4;
16433 mem3.aPool[i-1].u.hdr.size4x &= ~1;
16434 mem3.aPool[i+size-1].u.hdr.prevSize = size;
16435 mem3.aPool[i+size-1].u.hdr.size4x &= ~2;
16440 while( (mem3.aPool[mem3.iMaster-1].u.hdr.size4x&2)==0 ){
16441 size = mem3.aPool[mem3.iMaster-1].u.hdr.prevSize;
16445 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
16446 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
16447 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = mem3.szMaster;
16449 x = mem3.aPool[mem3.iMaster-1].u.hdr.size4x & 2;
16450 while( (mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x&1)==0 ){
16452 mem3.szMaster += mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.size4x/4;
16453 mem3.aPool[mem3.iMaster-1].u.hdr.size4x = mem3.szMaster*4 | x;
16454 mem3.aPool[mem3.iMaster+mem3.szMaster-1].u.hdr.prevSize = mem3.szMaster;
16468 assert( (pBlock[-1].u.hdr.size4x&1)!=0 );
16469 return (pBlock[-1].u.hdr.size4x&~3)*2 - 4;
16554 mem3.aPool[0].u.hdr.size4x = (mem3.szMaster<<2) + 2;
16555 mem3.aPool[mem3.nPool].u.hdr.prevSize = mem3.nPool;
16556 mem3.aPool[mem3.nPool].u.hdr.size4x = 1;
16594 size = mem3.aPool[i-1].u.hdr.size4x;
16600 if( (size&1)==0 && mem3.aPool[i+size/4-1].u.hdr.prevSize!=size/4 ){
16605 if( ((mem3.aPool[i+size/4-1].u.hdr.size4x&2)>>1)!=(size&1) ){
16622 (mem3.aPool[j-1].u.hdr.size4x/4)*8-8);
16631 (mem3.aPool[j-1].u.hdr.size4x/4)*8-8);
45790 WalIndexHdr hdr; /* Wal-index header for current transaction */
45999 ** Write the header information in pWal->hdr into the wal-index.
46001 ** The checksum on pWal->hdr is updated before it is written.
46008 pWal->hdr.isInit = 1;
46009 pWal->hdr.iVersion = WALINDEX_MAX_VERSION;
46010 walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum);
46011 memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
46013 memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
46037 u32 *aCksum = pWal->hdr.aFrameCksum;
46041 memcpy(&aFrame[8], pWal->hdr.aSalt, 8);
46043 nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
46064 u32 *aCksum = pWal->hdr.aFrameCksum;
46071 if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){
46087 nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
46259 ** than pWal->hdr.mxFrame.
46261 ** This function is called whenever pWal->hdr.mxFrame is decreased due
46264 ** At most only the hash table containing pWal->hdr.mxFrame needs to be
46266 ** pWal->hdr.mxFrame advances to the point where those hash tables are
46278 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE-1 );
46279 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE );
46280 testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE+1 );
46282 if( pWal->hdr.mxFrame==0 ) return;
46285 ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed
46288 assert( pWal->nWiData>walFramePage(pWal->hdr.mxFrame) );
46289 assert( pWal->apWiData[walFramePage(pWal->hdr.mxFrame)] );
46290 walHashGet(pWal, walFramePage(pWal->hdr.mxFrame), &aHash, &aPgno, &iZero);
46293 ** than pWal->hdr.mxFrame.
46295 iLimit = pWal->hdr.mxFrame - iZero;
46304 ** frame numbers greater than pWal->hdr.mxFrame.
46445 memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
46484 pWal->hdr.bigEndCksum = (u8)(magic&0x00000001);
46487 memcpy(&pWal->hdr.aSalt, &aBuf[16], 8);
46490 walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN,
46491 aBuf, WAL_HDRSIZE-2*4, 0, pWal->hdr.aFrameCksum
46493 if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24])
46494 || pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28])
46533 pWal->hdr.mxFrame = iFrame;
46534 pWal->hdr.nPage = nTruncate;
46535 pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16));
46538 aFrameCksum[0] = pWal->hdr.aFrameCksum[0];
46539 aFrameCksum[1] = pWal->hdr.aFrameCksum[1];
46550 pWal->hdr.aFrameCksum[0] = aFrameCksum[0];
46551 pWal->hdr.aFrameCksum[1] = aFrameCksum[1];
46568 if( pWal->hdr.nPage ){
46570 pWal->hdr.nPage, pWal->zWalName
46892 assert( pWal->ckptLock && pWal->hdr.mxFrame>0 );
46893 iLast = pWal->hdr.mxFrame;
46981 return (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
47038 if( pInfo->nBackfill>=pWal->hdr.mxFrame ) return SQLITE_OK;
47054 mxSafeFrame = pWal->hdr.mxFrame;
47055 mxPage = pWal->hdr.nPage;
47059 assert( y<=pWal->hdr.mxFrame );
47113 i64 szDb = pWal->hdr.nPage*(i64)szPage;
47142 if( pInfo->nBackfill<pWal->hdr.mxFrame ){
47145 assert( mxSafeFrame==pWal->hdr.mxFrame );
47252 ** pWal->hdr, then pWal->hdr is updated to the content of the new header
47292 if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){
47294 memcpy(&pWal->hdr, &h1, sizeof(WalIndexHdr));
47295 pWal->szPage = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16);
47305 ** Read the wal-index header from the wal-index and into pWal->hdr.
47309 ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is
47310 ** changed by this opertion. If pWal->hdr is unchanged, set *pChanged
47370 if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){
47395 ** to make a copy of the wal-index header into pWal->hdr. If the
47418 ** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0
47502 if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame ){
47509 if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){
47536 ** but not exceeding pWal->hdr.mxFrame and lock that entry.
47542 if( mxReadMark<=thisMark && thisMark<=pWal->hdr.mxFrame ){
47551 && (mxReadMark<pWal->hdr.mxFrame || mxI==0)
47556 mxReadMark = pInfo->aReadMark[i] = pWal->hdr.mxFrame;
47582 ** that occur later in the log than pWal->hdr.mxFrame may have been
47585 ** pWal->hdr.mxFrame risks reading a corrupted snapshot. So, retry
47596 || memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr))
47601 assert( mxReadMark<=pWal->hdr.mxFrame );
47664 u32 iLast = pWal->hdr.mxFrame; /* Last page in WAL for this reader */
47754 sz = pWal->hdr.szPage;
47774 return pWal->hdr.nPage;
47817 if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){
47854 Pgno iMax = pWal->hdr.mxFrame;
47860 memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr));
47862 for(iFrame=pWal->hdr.mxFrame+1;
47894 aWalData[0] = pWal->hdr.mxFrame;
47895 aWalData[1] = pWal->hdr.aFrameCksum[0];
47896 aWalData[2] = pWal->hdr.aFrameCksum[1];
47910 assert( aWalData[3]!=pWal->nCkpt || aWalData[0]<=pWal->hdr.mxFrame );
47921 if( aWalData[0]<pWal->hdr.mxFrame ){
47922 pWal->hdr.mxFrame = aWalData[0];
47923 pWal->hdr.aFrameCksum[0] = aWalData[1];
47924 pWal->hdr.aFrameCksum[1] = aWalData[2];
47937 ** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left
47941 ** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
47950 assert( pInfo->nBackfill==pWal->hdr.mxFrame );
47967 u32 *aSalt = pWal->hdr.aSalt; /* Big-endian salt values */
47970 pWal->hdr.mxFrame = 0;
48096 pWal, cnt, pWal->hdr.mxFrame, isCommit ? "Commit" : "Spill"));
48101 ** log file, instead of appending to it at pWal->hdr.mxFrame.
48111 iFrame = pWal->hdr.mxFrame;
48120 if( pWal->nCkpt==0 ) sqlite3_randomness(8, pWal->hdr.aSalt);
48121 memcpy(&aWalHdr[16], pWal->hdr.aSalt, 8);
48127 pWal->hdr.bigEndCksum = SQLITE_BIGENDIAN;
48128 pWal->hdr.aFrameCksum[0] = aCksum[0];
48129 pWal->hdr.aFrameCksum[1] = aCksum[1];
48220 iFrame = pWal->hdr.mxFrame;
48233 pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16));
48236 pWal->hdr.mxFrame = iFrame;
48238 pWal->hdr.iChange++;
48239 pWal->hdr.nPage = nTruncate;
48317 if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){
48325 if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame;
48337 memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
50457 int hdr; /* Offset to the page header */
50476 hdr = pPage->hdrOffset;
50479 assert( nCell==get2byte(&data[hdr+3]) );
50481 cbrk = get2byte(&data[hdr+5]);
50519 put2byte(&data[hdr+5], cbrk);
50520 data[hdr+1] = 0;
50521 data[hdr+2] = 0;
50522 data[hdr+7] = 0;
50545 const int hdr = pPage->hdrOffset; /* Local cache of pPage->hdrOffset */
50562 nFrag = data[hdr+7];
50563 assert( pPage->cellOffset == hdr + 12 - 4*pPage->leaf );
50565 top = get2byteNotZero(&data[hdr+5]);
50575 top = get2byteNotZero(&data[hdr+5]);
50582 for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){
50596 data[hdr+7] = (u8)(nFrag + x);
50617 top = get2byteNotZero(&data[hdr+5]);
50629 put2byte(&data[hdr+5], top);
50644 int addr, pbegin, hdr;
50670 hdr = pPage->hdrOffset;
50671 addr = hdr + 1;
50690 addr = hdr + 1;
50699 if( (frag<0) || (frag>(int)data[hdr+7]) ){
50702 data[hdr+7] -= (u8)frag;
50713 if( data[hdr+1]==data[hdr+5] && data[hdr+2]==data[hdr+6] ){
50715 pbegin = get2byte(&data[hdr+1]);
50716 memcpy(&data[hdr+1], &data[pbegin], 2);
50717 top = get2byte(&data[hdr+5]) + get2byte(&data[pbegin+2]);
50718 put2byte(&data[hdr+5], top);
50781 u8 hdr; /* Offset to beginning of page header */
50793 hdr = pPage->hdrOffset;
50795 if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT;
50800 pPage->cellOffset = cellOffset = hdr + 12 - 4*pPage->leaf;
50803 top = get2byteNotZero(&data[hdr+5]);
50804 pPage->nCell = get2byte(&data[hdr+3]);
50844 pc = get2byte(&data[hdr+1]);
50845 nFree = data[hdr+7] + top;
50886 u8 hdr = pPage->hdrOffset;
50895 memset(&data[hdr], 0, pBt->usableSize - hdr);
50897 data[hdr] = (char)flags;
50898 first = hdr + 8 + 4*((flags&PTF_LEAF)==0 ?1:0);
50899 memset(&data[hdr+1], 0, 4);
50900 data[hdr+7] = 0;
50901 put2byte(&data[hdr+5], pBt->usableSize);
50904 pPage->hdrOffset = hdr;
51696 int nPageHeader; /* Number of pages in the database according to hdr */
54869 int hdr; /* Beginning of the header. 0 most pages. 100 page 1 */
54880 hdr = pPage->hdrOffset;
54881 testcase( pc==get2byte(&data[hdr+5]) );
54883 if( pc < (u32)get2byte(&data[hdr+5]) || pc+sz > pPage->pBt->usableSize ){
54899 put2byte(&data[hdr+3], pPage->nCell);
55022 const int hdr = pPage->hdrOffset; /* Offset of header on pPage */
55033 assert( get2byteNotZero(&data[hdr+5])==nUsable );
55044 put2byte(&data[hdr+3], nCell);
55045 put2byte(&data[hdr+5], cellbody);
57099 int hdr, cellStart;
57242 hdr = pPage->hdrOffset;
57247 int contentOffset = get2byteNotZero(&data[hdr+5]);
57251 nCell = get2byte(&data[hdr+3]);
57252 cellStart = hdr + 12 - 4*pPage->leaf;
57267 i = get2byte(&data[hdr+1]);
57288 if( cnt!=data[hdr+7] ){
57291 cnt, data[hdr+7], iPage);
67390 ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 |
67398 ** hdr-size field is also a varint which is the offset from the beginning