mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Reduce the size of VdbeCursor again, this time without a performance hit.
FossilOrigin-Name: 933939932c44bccb0958f203a5bd24e683c1cf38
This commit is contained in:
11
src/vdbe.c
11
src/vdbe.c
@@ -212,9 +212,8 @@ static VdbeCursor *allocateCursor(
|
||||
int nByte;
|
||||
VdbeCursor *pCx = 0;
|
||||
nByte =
|
||||
ROUND8(sizeof(VdbeCursor)) +
|
||||
(isBtreeCursor?sqlite3BtreeCursorSize():0) +
|
||||
(2*nField+2)*sizeof(u32);
|
||||
ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField +
|
||||
(isBtreeCursor?sqlite3BtreeCursorSize():0);
|
||||
|
||||
assert( iCur<p->nCursor );
|
||||
if( p->apCsr[iCur] ){
|
||||
@@ -226,12 +225,9 @@ static VdbeCursor *allocateCursor(
|
||||
memset(pCx, 0, sizeof(VdbeCursor));
|
||||
pCx->iDb = iDb;
|
||||
pCx->nField = nField;
|
||||
if( nField ){
|
||||
pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))];
|
||||
}
|
||||
if( isBtreeCursor ){
|
||||
pCx->pCursor = (BtCursor*)
|
||||
&pMem->z[ROUND8(sizeof(VdbeCursor))+(2*nField+2)*sizeof(u32)];
|
||||
&pMem->z[ROUND8(sizeof(VdbeCursor))+2*sizeof(u32)*nField];
|
||||
sqlite3BtreeCursorZero(pCx->pCursor);
|
||||
}
|
||||
}
|
||||
@@ -5807,7 +5803,6 @@ case OP_VOpen: {
|
||||
pCur = allocateCursor(p, pOp->p1, 0, -1, 0);
|
||||
if( pCur ){
|
||||
pCur->pVtabCursor = pVtabCursor;
|
||||
pCur->pModule = pVtabCursor->pVtab->pModule;
|
||||
}else{
|
||||
db->mallocFailed = 1;
|
||||
pModule->xClose(pVtabCursor);
|
||||
|
Reference in New Issue
Block a user