aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-07-24 11:28:28 +0000
committerdan <dan@noemail.net>2010-07-24 11:28:28 +0000
commitd46def77db74a7dfadabb16da57c25d83af0c248 (patch)
tree8483a41f5c4a98751242c17018d127276a5eae6c /src/analyze.c
parent5419ee5f2f068601ebc494b104f92cadfc7de5e7 (diff)
downloadsqlite-d46def77db74a7dfadabb16da57c25d83af0c248.tar.gz
sqlite-d46def77db74a7dfadabb16da57c25d83af0c248.zip
Experimental code to measure memory consumed by database schemas and prepared statements.
FossilOrigin-Name: 9aa30342f4de4eff630520ea8e07ad253d3f0877
Diffstat (limited to 'src/analyze.c')
-rw-r--r--src/analyze.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/analyze.c b/src/analyze.c
index c41fba343..d96deb3c2 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -490,18 +490,17 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
** If the Index.aSample variable is not NULL, delete the aSample[] array
** and its contents.
*/
-void sqlite3DeleteIndexSamples(Index *pIdx){
+void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
#ifdef SQLITE_ENABLE_STAT2
if( pIdx->aSample ){
int j;
for(j=0; j<SQLITE_INDEX_SAMPLES; j++){
IndexSample *p = &pIdx->aSample[j];
if( p->eType==SQLITE_TEXT || p->eType==SQLITE_BLOB ){
- sqlite3_free(p->u.z);
+ sqlite3DbFree(db, p->u.z);
}
}
- sqlite3DbFree(0, pIdx->aSample);
- pIdx->aSample = 0;
+ sqlite3DbFree(db, pIdx->aSample);
}
#else
UNUSED_PARAMETER(pIdx);
@@ -542,7 +541,8 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
Index *pIdx = sqliteHashData(i);
sqlite3DefaultRowEst(pIdx);
- sqlite3DeleteIndexSamples(pIdx);
+ sqlite3DeleteIndexSamples(db, pIdx);
+ pIdx->aSample = 0;
}
/* Check to make sure the sqlite_stat1 table exists */