[RELEASE] u22-v03
This version is submitted to U22 breau.
This commit is contained in:
0
tool/CMakeLists.txt
Normal file
0
tool/CMakeLists.txt
Normal file
14
tool/bin2c.sh
Executable file
14
tool/bin2c.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
name=`echo "$1" | sed -e 's/[^A-z0-9_]/_/g'`
|
||||
|
||||
hpath="$2.h"
|
||||
cpath="$2.c"
|
||||
|
||||
data=`cat $in | xxd -i`
|
||||
size=`echo $data | wc -w`
|
||||
|
||||
echo "const char $name[$size] = {$data};" > $cpath
|
||||
echo "extern const char $name[$size];" > $hpath
|
35
tool/leak-check.sh
Executable file
35
tool/leak-check.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script works only with memory-trace file generated in Linux.
|
||||
|
||||
file="memory-trace"
|
||||
if [ ! -f $file ]; then
|
||||
echo no memory trace file found
|
||||
exit 1
|
||||
fi
|
||||
|
||||
declare -A addrs
|
||||
|
||||
while read line; do
|
||||
IFS=" " read -r type addr1 trash1 addr2 trash2 <<< $line
|
||||
|
||||
case "$type" in
|
||||
"new")
|
||||
addrs[$addr1]="allocated"
|
||||
;;
|
||||
"resize")
|
||||
addrs[$addr1]="freed"
|
||||
addrs[$addr2]="allocated"
|
||||
;;
|
||||
"delete")
|
||||
addrs[$addr1]="freed"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done < $file
|
||||
|
||||
for addr in "${!addrs[@]}"; do
|
||||
if [ "${addrs[$addr]}" == "allocated" ]; then
|
||||
echo $addr
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user