mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Reduce the size of the CellInfo object from 32 to 24 bytes on 64-bit machines.
FossilOrigin-Name: 7850715406458a61cff9eba5ad915f61f6d99482
This commit is contained in:
17
manifest
17
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sthe\sspellfix1_scriptcode()\sfunction\sto\signore\swhitespace\sand\spunctuation,\nand\sto\srecognize\shebrew\sand\sarabic\sscripts.
|
C Reduce\sthe\ssize\sof\sthe\sCellInfo\sobject\sfrom\s32\sto\s24\sbytes\son\s64-bit\smachines.
|
||||||
D 2015-12-17T14:18:21.904
|
D 2015-12-18T03:59:16.912
|
||||||
F Makefile.in 28bcd6149e050dff35d4dcfd97e890cd387a499d
|
F Makefile.in 28bcd6149e050dff35d4dcfd97e890cd387a499d
|
||||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||||
F Makefile.msc 5fff077fcc46de7714ed6eebb6159a4c00eab751
|
F Makefile.msc 5fff077fcc46de7714ed6eebb6159a4c00eab751
|
||||||
@@ -276,9 +276,9 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
|
|||||||
F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc
|
F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc
|
||||||
F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf
|
F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf
|
||||||
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
|
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
|
||||||
F src/btree.c 84ede51e371a11c3dbb3e24ccc5e3e99594a6c00
|
F src/btree.c 5ac3f868d4f20a67f0f00a1014940f902b511558
|
||||||
F src/btree.h 2d76dee44704c47eed323356a758662724b674a0
|
F src/btree.h 2d76dee44704c47eed323356a758662724b674a0
|
||||||
F src/btreeInt.h 3ab435ed27adea54d040584b0bcc488ee7db1e38
|
F src/btreeInt.h b5f2651b41808f038dee9282c5dc0232ce6532d3
|
||||||
F src/build.c e83da4d004a4e050c01acbb821ff7a7b1019c29b
|
F src/build.c e83da4d004a4e050c01acbb821ff7a7b1019c29b
|
||||||
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
|
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
|
||||||
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
|
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
|
||||||
@@ -1405,7 +1405,10 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P 85ebd46c701e0a094a4690cd8f1d0cbae9aa257c
|
P 7adfa4a5794e47f97491c08abeaaac90e826b331
|
||||||
R 70cdc580d7d9b92b032d33f5e0d50f2e
|
R 235be975857692987ba30e4b3c7418db
|
||||||
|
T *branch * optimize-cellinfo
|
||||||
|
T *sym-optimize-cellinfo *
|
||||||
|
T -sym-trunk *
|
||||||
U drh
|
U drh
|
||||||
Z 6d4b5ed9cd1870281d7d851922f323d8
|
Z cc2df912aa2ee31453d3047ea3468b1b
|
||||||
|
@@ -1 +1 @@
|
|||||||
7adfa4a5794e47f97491c08abeaaac90e826b331
|
7850715406458a61cff9eba5ad915f61f6d99482
|
33
src/btree.c
33
src/btree.c
@@ -1051,8 +1051,7 @@ static SQLITE_NOINLINE void btreeParseCellAdjustSizeForOverflow(
|
|||||||
}else{
|
}else{
|
||||||
pInfo->nLocal = (u16)minLocal;
|
pInfo->nLocal = (u16)minLocal;
|
||||||
}
|
}
|
||||||
pInfo->iOverflow = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell);
|
pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
|
||||||
pInfo->nSize = pInfo->iOverflow + 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1084,7 +1083,6 @@ static void btreeParseCellPtrNoPayload(
|
|||||||
pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
|
pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
|
||||||
pInfo->nPayload = 0;
|
pInfo->nPayload = 0;
|
||||||
pInfo->nLocal = 0;
|
pInfo->nLocal = 0;
|
||||||
pInfo->iOverflow = 0;
|
|
||||||
pInfo->pPayload = 0;
|
pInfo->pPayload = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1154,7 +1152,6 @@ static void btreeParseCellPtr(
|
|||||||
pInfo->nSize = nPayload + (u16)(pIter - pCell);
|
pInfo->nSize = nPayload + (u16)(pIter - pCell);
|
||||||
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
||||||
pInfo->nLocal = (u16)nPayload;
|
pInfo->nLocal = (u16)nPayload;
|
||||||
pInfo->iOverflow = 0;
|
|
||||||
}else{
|
}else{
|
||||||
btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
|
btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
|
||||||
}
|
}
|
||||||
@@ -1193,7 +1190,6 @@ static void btreeParseCellPtrIndex(
|
|||||||
pInfo->nSize = nPayload + (u16)(pIter - pCell);
|
pInfo->nSize = nPayload + (u16)(pIter - pCell);
|
||||||
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
||||||
pInfo->nLocal = (u16)nPayload;
|
pInfo->nLocal = (u16)nPayload;
|
||||||
pInfo->iOverflow = 0;
|
|
||||||
}else{
|
}else{
|
||||||
btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
|
btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
|
||||||
}
|
}
|
||||||
@@ -1309,8 +1305,8 @@ static void ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell, int *pRC){
|
|||||||
if( *pRC ) return;
|
if( *pRC ) return;
|
||||||
assert( pCell!=0 );
|
assert( pCell!=0 );
|
||||||
pPage->xParseCell(pPage, pCell, &info);
|
pPage->xParseCell(pPage, pCell, &info);
|
||||||
if( info.iOverflow ){
|
if( info.nLocal<info.nPayload ){
|
||||||
Pgno ovfl = get4byte(&pCell[info.iOverflow]);
|
Pgno ovfl = get4byte(&pCell[info.nSize-4]);
|
||||||
ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, pRC);
|
ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, pRC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3348,11 +3344,11 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
|
|||||||
if( eType==PTRMAP_OVERFLOW1 ){
|
if( eType==PTRMAP_OVERFLOW1 ){
|
||||||
CellInfo info;
|
CellInfo info;
|
||||||
pPage->xParseCell(pPage, pCell, &info);
|
pPage->xParseCell(pPage, pCell, &info);
|
||||||
if( info.iOverflow
|
if( info.nLocal<info.nPayload
|
||||||
&& pCell+info.iOverflow+3<=pPage->aData+pPage->maskPage
|
&& pCell+info.nSize-1<=pPage->aData+pPage->maskPage
|
||||||
&& iFrom==get4byte(&pCell[info.iOverflow])
|
&& iFrom==get4byte(pCell+info.nSize-4)
|
||||||
){
|
){
|
||||||
put4byte(&pCell[info.iOverflow], iTo);
|
put4byte(pCell+info.nSize-4, iTo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@@ -5994,13 +5990,13 @@ static int clearCell(
|
|||||||
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
|
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
|
||||||
pPage->xParseCell(pPage, pCell, &info);
|
pPage->xParseCell(pPage, pCell, &info);
|
||||||
*pnSize = info.nSize;
|
*pnSize = info.nSize;
|
||||||
if( info.iOverflow==0 ){
|
if( info.nLocal==info.nPayload ){
|
||||||
return SQLITE_OK; /* No overflow pages. Return without doing anything */
|
return SQLITE_OK; /* No overflow pages. Return without doing anything */
|
||||||
}
|
}
|
||||||
if( pCell+info.iOverflow+3 > pPage->aData+pPage->maskPage ){
|
if( pCell+info.nSize-1 > pPage->aData+pPage->maskPage ){
|
||||||
return SQLITE_CORRUPT_BKPT; /* Cell extends past end of page */
|
return SQLITE_CORRUPT_BKPT; /* Cell extends past end of page */
|
||||||
}
|
}
|
||||||
ovflPgno = get4byte(&pCell[info.iOverflow]);
|
ovflPgno = get4byte(pCell + info.nSize - 4);
|
||||||
assert( pBt->usableSize > 4 );
|
assert( pBt->usableSize > 4 );
|
||||||
ovflPageSize = pBt->usableSize - 4;
|
ovflPageSize = pBt->usableSize - 4;
|
||||||
nOvfl = (info.nPayload - info.nLocal + ovflPageSize - 1)/ovflPageSize;
|
nOvfl = (info.nPayload - info.nLocal + ovflPageSize - 1)/ovflPageSize;
|
||||||
@@ -6149,7 +6145,6 @@ static int fillInCell(
|
|||||||
assert( info.nKey==nKey );
|
assert( info.nKey==nKey );
|
||||||
assert( *pnSize == info.nSize );
|
assert( *pnSize == info.nSize );
|
||||||
assert( spaceLeft == info.nLocal );
|
assert( spaceLeft == info.nLocal );
|
||||||
assert( pPrior == &pCell[info.iOverflow] );
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -6859,8 +6854,8 @@ static int ptrmapCheckPages(MemPage **apPage, int nPage){
|
|||||||
|
|
||||||
z = findCell(pPage, j);
|
z = findCell(pPage, j);
|
||||||
pPage->xParseCell(pPage, z, &info);
|
pPage->xParseCell(pPage, z, &info);
|
||||||
if( info.iOverflow ){
|
if( info.nLocal<info.nPayload ){
|
||||||
Pgno ovfl = get4byte(&z[info.iOverflow]);
|
Pgno ovfl = get4byte(&z[info.nSize-4]);
|
||||||
ptrmapGet(pBt, ovfl, &e, &n);
|
ptrmapGet(pBt, ovfl, &e, &n);
|
||||||
assert( n==pPage->pgno && e==PTRMAP_OVERFLOW1 );
|
assert( n==pPage->pgno && e==PTRMAP_OVERFLOW1 );
|
||||||
}
|
}
|
||||||
@@ -9166,9 +9161,9 @@ static int checkTreePage(
|
|||||||
if( info.nPayload>info.nLocal ){
|
if( info.nPayload>info.nLocal ){
|
||||||
int nPage; /* Number of pages on the overflow chain */
|
int nPage; /* Number of pages on the overflow chain */
|
||||||
Pgno pgnoOvfl; /* First page of the overflow chain */
|
Pgno pgnoOvfl; /* First page of the overflow chain */
|
||||||
assert( pc + info.iOverflow <= usableSize );
|
assert( pc + info.nSize - 4 <= usableSize );
|
||||||
nPage = (info.nPayload - info.nLocal + usableSize - 5)/(usableSize - 4);
|
nPage = (info.nPayload - info.nLocal + usableSize - 5)/(usableSize - 4);
|
||||||
pgnoOvfl = get4byte(&pCell[info.iOverflow]);
|
pgnoOvfl = get4byte(&pCell[info.nSize - 4]);
|
||||||
#ifndef SQLITE_OMIT_AUTOVACUUM
|
#ifndef SQLITE_OMIT_AUTOVACUUM
|
||||||
if( pBt->autoVacuum ){
|
if( pBt->autoVacuum ){
|
||||||
checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
|
checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
|
||||||
|
@@ -470,7 +470,6 @@ struct CellInfo {
|
|||||||
u8 *pPayload; /* Pointer to the start of payload */
|
u8 *pPayload; /* Pointer to the start of payload */
|
||||||
u32 nPayload; /* Bytes of payload */
|
u32 nPayload; /* Bytes of payload */
|
||||||
u16 nLocal; /* Amount of payload held locally, not on overflow */
|
u16 nLocal; /* Amount of payload held locally, not on overflow */
|
||||||
u16 iOverflow; /* Offset to overflow page number. Zero if no overflow */
|
|
||||||
u16 nSize; /* Size of the cell content on the main b-tree page */
|
u16 nSize; /* Size of the cell content on the main b-tree page */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user