[RELEASE] u22-v03

This version is submitted to U22 breau.
This commit is contained in:
2020-09-14 00:00:00 +00:00
parent 360595de37
commit 84c3a02b9a
357 changed files with 29223 additions and 0 deletions

0
tool/CMakeLists.txt Normal file
View File

14
tool/bin2c.sh Executable file
View 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
View 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