6e142f5479
FossilOrigin-Name: bf98cf82a73c54c4eced04994bb1a019844dfc03
26 lines
410 B
Awk
26 lines
410 B
Awk
#
|
|
# This script looks for memory leaks by analyzing the output of "sqlite"
|
|
# when compiled with the MEMORY_DEBUG=2 option.
|
|
#
|
|
/^malloc / {
|
|
mem[$5] = $0
|
|
}
|
|
/^realloc / {
|
|
mem[$7] = "";
|
|
mem[$9] = $0
|
|
}
|
|
/^free / {
|
|
mem[$5] = "";
|
|
}
|
|
/^string at / {
|
|
addr = $3
|
|
sub("string at " addr " is ","")
|
|
str[addr] = $0
|
|
}
|
|
END {
|
|
for(addr in mem){
|
|
if( mem[addr]=="" ) continue
|
|
print mem[addr], str[addr]
|
|
}
|
|
}
|