diff options
author | drh <drh@noemail.net> | 2010-07-26 18:43:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-07-26 18:43:40 +0000 |
commit | eafc43b1569260e5ee1d0268cae7fa8ec619d7b8 (patch) | |
tree | 22c5baa7268f28dce01831872592a9dd26642fcc /test | |
parent | d2de9f4e6802d0f3c847a6f1dd5aa49a0eef70fb (diff) | |
download | sqlite-eafc43b1569260e5ee1d0268cae7fa8ec619d7b8.tar.gz sqlite-eafc43b1569260e5ee1d0268cae7fa8ec619d7b8.zip |
Add the SQLITE_STATUS_MALLOC_COUNT option for sqlite3_status().
FossilOrigin-Name: 8f8e442b3af553753e25c304efa289b626e3a227
Diffstat (limited to 'test')
-rw-r--r-- | test/tester.tcl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/tester.tcl b/test/tester.tcl index d9219559c..f485a6de5 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -441,8 +441,10 @@ proc finalize_testing {} { puts "$sqlite_open_file_count files were left open" incr nErr } - if {[sqlite3_memory_used]>0} { - puts "Unfreed memory: [sqlite3_memory_used] bytes" + if {[lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1]>0 || + [sqlite3_memory_used]>0} { + puts "Unfreed memory: [sqlite3_memory_used] bytes in\ + [lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1] allocations" incr nErr ifcapable memdebug||mem5||(mem3&&debug) { puts "Writing unfreed memory log to \"./memleak.txt\"" @@ -489,6 +491,9 @@ proc show_memstats {} { set val [format {now %10d max %10d max-size %10d} \ [lindex $x 1] [lindex $x 2] [lindex $y 2]] puts "Memory used: $val" + set x [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] + set val [format {now %10d max %10d} [lindex $x 1] [lindex $x 2]] + puts "Allocation count: $val" set x [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] set y [sqlite3_status SQLITE_STATUS_PAGECACHE_SIZE 0] set val [format {now %10d max %10d max-size %10d} \ |