/ Check-in [79298fe8]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Optimization to the out2Prerelease() helper routine in the VDBE engine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 79298fe8c42f64b6a6110a70b84033873ac0630d
User & Date: drh 2015-10-15 17:31:41
Context
2015-10-15
18:04
Add the OP_IntCopy opcode - an optimized version of OP_SCopy that only works for integer values. check-in: 3a2f73a4 user: drh tags: trunk
17:31
Optimization to the out2Prerelease() helper routine in the VDBE engine. check-in: 79298fe8 user: drh tags: trunk
17:21
Remove a superfluous conditional from the memory allocation initialization. check-in: 9ccf8f8d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

   514    514     return 1;
   515    515   }
   516    516   #endif
   517    517   
   518    518   /*
   519    519   ** Return the register of pOp->p2 after first preparing it to be
   520    520   ** overwritten with an integer value.
   521         -*/ 
          521  +*/
          522  +static SQLITE_NOINLINE Mem *out2PrereleaseWithClear(Mem *pOut){
          523  +  sqlite3VdbeMemSetNull(pOut);
          524  +  pOut->flags = MEM_Int;
          525  +  return pOut;
          526  +}
   522    527   static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){
   523    528     Mem *pOut;
   524    529     assert( pOp->p2>0 );
   525    530     assert( pOp->p2<=(p->nMem-p->nCursor) );
   526    531     pOut = &p->aMem[pOp->p2];
   527    532     memAboutToChange(p, pOut);
   528         -  if( VdbeMemDynamic(pOut) ) sqlite3VdbeMemSetNull(pOut);
   529         -  pOut->flags = MEM_Int;
   530         -  return pOut;
          533  +  if( VdbeMemDynamic(pOut) ){
          534  +    return out2PrereleaseWithClear(pOut);
          535  +  }else{
          536  +    pOut->flags = MEM_Int;
          537  +    return pOut;
          538  +  }
   531    539   }
   532    540   
   533    541   
   534    542   /*
   535    543   ** Execute as much of a VDBE program as we can.
   536    544   ** This is the core of sqlite3_step().  
   537    545   */