Reorder the fields in the VdbeCursor object so that those that need to be

bulk zeroed on allocation are grouped at the beginning, and the memset()
only runs over those fields that really need it.

FossilOrigin-Name: 8165f88bb1d40693d67005a8d5dc499085f64b91
This commit is contained in:
drh
2016-12-10 12:58:15 +00:00
parent 719da30d53
commit fbd8cbdcf5
6 changed files with 61 additions and 62 deletions
+3 -3
View File
@@ -2006,15 +2006,15 @@ void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
if( pCx==0 ){
return;
}
assert( pCx->pBt==0 || pCx->eCurType==CURTYPE_BTREE );
assert( pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE );
switch( pCx->eCurType ){
case CURTYPE_SORTER: {
sqlite3VdbeSorterClose(p->db, pCx);
break;
}
case CURTYPE_BTREE: {
if( pCx->pBt ){
sqlite3BtreeClose(pCx->pBt);
if( pCx->pBtx ){
sqlite3BtreeClose(pCx->pBtx);
/* The pCx->pCursor will be close automatically, if it exists, by
** the call above. */
}else{