diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-SC_OLD-e36d23a85ebff914d74bb541558c2b6082b78edb.zip opensim-SC_OLD-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz opensim-SC_OLD-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2 opensim-SC_OLD-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz |
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk b/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk new file mode 100644 index 0000000..928d3b6 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/tool/memleak.awk | |||
@@ -0,0 +1,29 @@ | |||
1 | # | ||
2 | # This script looks for memory leaks by analyzing the output of "sqlite" | ||
3 | # when compiled with the SQLITE_DEBUG=2 option. | ||
4 | # | ||
5 | /[0-9]+ malloc / { | ||
6 | mem[$6] = $0 | ||
7 | } | ||
8 | /[0-9]+ realloc / { | ||
9 | mem[$8] = ""; | ||
10 | mem[$10] = $0 | ||
11 | } | ||
12 | /[0-9]+ free / { | ||
13 | if (mem[$6]=="") { | ||
14 | print "*** free without a malloc at",$6 | ||
15 | } | ||
16 | mem[$6] = ""; | ||
17 | str[$6] = "" | ||
18 | } | ||
19 | /^string at / { | ||
20 | addr = $4 | ||
21 | sub("string at " addr " is ","") | ||
22 | str[addr] = $0 | ||
23 | } | ||
24 | END { | ||
25 | for(addr in mem){ | ||
26 | if( mem[addr]=="" ) continue | ||
27 | print mem[addr], str[addr] | ||
28 | } | ||
29 | } | ||