minorGems/util/development/leakTracer/LeakCheck
raw| 1 | #!/bin/sh |
| 2 | if [ $# -lt 1 ] ; then |
| 3 | echo "Usage: $0 <program [program parameters]>" |
| 4 | exit 1 |
| 5 | fi |
| 6 | |
| 7 | # this looks in the same directory, this |
| 8 | # LeakCheck script resides; modify to your |
| 9 | # needs: |
| 10 | SHLIB=`dirname $0`/LeakTracer.so |
| 11 | if [ ! -x $SHLIB ] ; then |
| 12 | echo "$SHLIB not found" |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | if [ -z "$LEAKTRACE_FILE" ] ; then |
| 17 | rm -f leak.out |
| 18 | else |
| 19 | rm -f "$LEAKTRACE_FILE" |
| 20 | fi |
| 21 | export LD_PRELOAD=$SHLIB |
| 22 | exec $@ |