/ Check-in [212d05d3]
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:Remove redundant code from sqlite3GetTempReg(). (CVS 5342)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 212d05d38c8126f99c028c5ab021b219487fa01e
User & Date: danielk1977 2008-07-04 09:41:39
Context
2008-07-04
10:56
Fix for explicitly inserting a NULL value into the rowid column of a virtual table. (CVS 5343) check-in: a7f3b431 user: danielk1977 tags: trunk
09:41
Remove redundant code from sqlite3GetTempReg(). (CVS 5342) check-in: 212d05d3 user: danielk1977 tags: trunk
09:15
Remove references to temporary registers from the compiler column-cache when such registers are released. Fix for #3201. (CVS 5341) check-in: f099d677 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.382 2008/07/04 09:15:11 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** Return the 'affinity' of the expression pExpr if any.
**
................................................................................
  }
}

/*
** Allocate or deallocate temporary use registers during code generation.
*/
int sqlite3GetTempReg(Parse *pParse){
  int i, r;
  if( pParse->nTempReg==0 ){
    return ++pParse->nMem;
  }
  for(i=0; i<pParse->nTempReg; i++){
    r = pParse->aTempReg[i];
    if( usedAsColumnCache(pParse, r, r) ) continue;
  }
  if( i>=pParse->nTempReg ){
    return ++pParse->nMem;
  }
  while( i<pParse->nTempReg-1 ){
    pParse->aTempReg[i] = pParse->aTempReg[i+1];
  }
  pParse->nTempReg--;
  return r;
}
void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
  if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
    sqlite3ExprWritableRegister(pParse, iReg, iReg);
    pParse->aTempReg[pParse->nTempReg++] = iReg;
  }
}







|







 







<



<
|
<
<
<
<
<
<
<
<
<
<







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
3545
3546
3547
3548
3549
3550
3551

3552
3553
3554

3555










3556
3557
3558
3559
3560
3561
3562
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.383 2008/07/04 09:41:39 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** Return the 'affinity' of the expression pExpr if any.
**
................................................................................
  }
}

/*
** Allocate or deallocate temporary use registers during code generation.
*/
int sqlite3GetTempReg(Parse *pParse){

  if( pParse->nTempReg==0 ){
    return ++pParse->nMem;
  }

  return pParse->aTempReg[--pParse->nTempReg];










}
void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
  if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
    sqlite3ExprWritableRegister(pParse, iReg, iReg);
    pParse->aTempReg[pParse->nTempReg++] = iReg;
  }
}