memleak2.awk revision 7c478bd95313f5f23a4c958a745db2134aa03244
#pragma ident "%Z%%M% %I% %E% SMI"
# This AWK script reads the output of testfixture when compiled for memory
# debugging. It generates SQL commands that can be fed into an sqlite
# instance to determine what memory is never freed. A typical usage would
# be as follows:
#
# make -f memleak.mk fulltest 2>mem.out
# awk -f ../sqlite/tool/memleak2.awk mem.out | ./sqlite :memory:
#
# The job performed by this script is the same as that done by memleak.awk.
# The difference is that this script uses much less memory when the size
# of the mem.out file is huge.
#
BEGIN {
print "CREATE TABLE mem(loc INTEGER PRIMARY KEY, src);"
}
}
}
}
END {
print "SELECT src FROM mem;"
}