1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Optimization to the out2Prerelease() helper routine in the VDBE engine.

FossilOrigin-Name: 79298fe8c42f64b6a6110a70b84033873ac0630d
This commit is contained in:
drh
2015-10-15 17:31:41 +00:00
parent 59a052359d
commit 9eef8c6934
3 changed files with 19 additions and 11 deletions

View File

@@ -518,16 +518,24 @@ static int checkSavepointCount(sqlite3 *db){
/*
** Return the register of pOp->p2 after first preparing it to be
** overwritten with an integer value.
*/
*/
static SQLITE_NOINLINE Mem *out2PrereleaseWithClear(Mem *pOut){
sqlite3VdbeMemSetNull(pOut);
pOut->flags = MEM_Int;
return pOut;
}
static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){
Mem *pOut;
assert( pOp->p2>0 );
assert( pOp->p2<=(p->nMem-p->nCursor) );
pOut = &p->aMem[pOp->p2];
memAboutToChange(p, pOut);
if( VdbeMemDynamic(pOut) ) sqlite3VdbeMemSetNull(pOut);
pOut->flags = MEM_Int;
return pOut;
if( VdbeMemDynamic(pOut) ){
return out2PrereleaseWithClear(pOut);
}else{
pOut->flags = MEM_Int;
return pOut;
}
}