aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk
diff options
context:
space:
mode:
authordan miller2007-10-20 02:49:29 +0000
committerdan miller2007-10-20 02:49:29 +0000
commite36d23a85ebff914d74bb541558c2b6082b78edb (patch)
tree54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk
parent* Fixed an issue whereby avatar chat distances were being calculated against ... (diff)
downloadopensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk29
1 files changed, 29 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk b/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk
new file mode 100644
index 0000000..5d81b70
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak2.awk
@@ -0,0 +1,29 @@
1# This AWK script reads the output of testfixture when compiled for memory
2# debugging. It generates SQL commands that can be fed into an sqlite
3# instance to determine what memory is never freed. A typical usage would
4# be as follows:
5#
6# make -f memleak.mk fulltest 2>mem.out
7# awk -f ../sqlite/tool/memleak2.awk mem.out | ./sqlite :memory:
8#
9# The job performed by this script is the same as that done by memleak.awk.
10# The difference is that this script uses much less memory when the size
11# of the mem.out file is huge.
12#
13BEGIN {
14 print "CREATE TABLE mem(loc INTEGER PRIMARY KEY, src);"
15}
16/[0-9]+ malloc / {
17 print "INSERT INTO mem VALUES(" strtonum($6) ",'" $0 "');"
18}
19/[0-9]+ realloc / {
20 print "INSERT INTO mem VALUES(" strtonum($10) \
21 ",(SELECT src FROM mem WHERE loc=" strtonum($8) "));"
22 print "DELETE FROM mem WHERE loc=" strtonum($8) ";"
23}
24/[0-9]+ free / {
25 print "DELETE FROM mem WHERE loc=" strtonum($6) ";"
26}
27END {
28 print "SELECT src FROM mem;"
29}