Work on reducing allocation leaks in read_number(). This is now improved, but not yet satisfactory.
This commit is contained in:
parent
e489d02069
commit
351ca5bd17
9 changed files with 275 additions and 17 deletions
22
unit-tests/allocation-tests/allocation-tester.sh
Executable file
22
unit-tests/allocation-tests/allocation-tester.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#1/bin/bash
|
||||
|
||||
echo "Case, Summary, Allocated, Deallocated, Not deallocated, Delta Allocated, Delta Deallocated, Delta Not Deallocated"
|
||||
basecase=`echo '' | ../../target/psse 2>&1 | grep Allocation | tr -d '[:punct:]'`
|
||||
bca=`echo ${basecase} | awk '{print $4}'`
|
||||
bcd=`echo ${basecase} | awk '{print $6}'`
|
||||
bcn=`echo ${basecase} | awk '{print $9}'`
|
||||
|
||||
echo "\"Basecase\", \"${basecase}\", ${bca}, ${bcd}, ${bcn}"
|
||||
|
||||
while IFS= read -r form; do
|
||||
allocation=`echo ${form} | ../../target/psse 2>&1 | grep Allocation | tr -d '[:punct:]'`
|
||||
tca=`echo ${allocation} | awk '{print $4}'`
|
||||
tcd=`echo ${allocation} | awk '{print $6}'`
|
||||
tcn=`echo ${allocation} | awk '{print $9}'`
|
||||
|
||||
dca=`echo "${tca} - ${bca}" | bc`
|
||||
dcd=`echo "${tcd} - ${bcd}" | bc`
|
||||
dcn=`echo "${tcn} - ${bcn}" | bc`
|
||||
|
||||
echo "\"${form}\", \"${allocation}\", ${tca}, ${tcd}, ${tcn}, ${dca}, ${dcd}, ${dcn}"
|
||||
done
|
||||
28
unit-tests/allocation-tests/allocation-tests.csv
Normal file
28
unit-tests/allocation-tests/allocation-tests.csv
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Case, Summary, Allocated, Deallocated, Not deallocated, Delta Allocated, Delta Deallocated, Delta Not Deallocated
|
||||
"Basecase", "Allocation summary allocated 19986 deallocated 245 not deallocated 19741", 19986, 245, 19741
|
||||
"", "Allocation summary allocated 19986 deallocated 245 not deallocated 19741", 19986, 245, 19741, 0, 0, 0
|
||||
"nil", "Allocation summary allocated 20019 deallocated 253 not deallocated 19766", 20019, 253, 19766, 33, 8, 25
|
||||
"()", "Allocation summary allocated 19990 deallocated 249 not deallocated 19741", 19990, 249, 19741, 4, 4, 0
|
||||
"(quote ())", "Allocation summary allocated 20025 deallocated 247 not deallocated 19778", 20025, 247, 19778, 39, 2, 37
|
||||
"(list)", "Allocation summary allocated 20023 deallocated 257 not deallocated 19766", 20023, 257, 19766, 37, 12, 25
|
||||
"(list )", "Allocation summary allocated 20023 deallocated 257 not deallocated 19766", 20023, 257, 19766, 37, 12, 25
|
||||
"(list 1)", "Allocation summary allocated 20033 deallocated 259 not deallocated 19774", 20033, 259, 19774, 47, 14, 33
|
||||
"(list 1 1)", "Allocation summary allocated 20043 deallocated 261 not deallocated 19782", 20043, 261, 19782, 57, 16, 41
|
||||
"(list 1 1 1)", "Allocation summary allocated 20053 deallocated 263 not deallocated 19790", 20053, 263, 19790, 67, 18, 49
|
||||
"(list 1 2 3)", "Allocation summary allocated 20053 deallocated 263 not deallocated 19790", 20053, 263, 19790, 67, 18, 49
|
||||
"(+)", "Allocation summary allocated 20022 deallocated 255 not deallocated 19767", 20022, 255, 19767, 36, 10, 26
|
||||
"(+ 1)", "Allocation summary allocated 20030 deallocated 257 not deallocated 19773", 20030, 257, 19773, 44, 12, 32
|
||||
"(+ 1 1)", "Allocation summary allocated 20039 deallocated 259 not deallocated 19780", 20039, 259, 19780, 53, 14, 39
|
||||
"(+ 1 1 1)", "Allocation summary allocated 20048 deallocated 261 not deallocated 19787", 20048, 261, 19787, 62, 16, 46
|
||||
"(+ 1 2 3)", "Allocation summary allocated 20048 deallocated 261 not deallocated 19787", 20048, 261, 19787, 62, 16, 46
|
||||
"(list 'a 'a 'a)", "Allocation summary allocated 20137 deallocated 278 not deallocated 19859", 20137, 278, 19859, 151, 33, 118
|
||||
"(list 'a 'b 'c)", "Allocation summary allocated 20137 deallocated 278 not deallocated 19859", 20137, 278, 19859, 151, 33, 118
|
||||
"(list :a :b :c)", "Allocation summary allocated 20107 deallocated 260 not deallocated 19847", 20107, 260, 19847, 121, 15, 106
|
||||
"(list :alpha :bravo :charlie)", "Allocation summary allocated 20471 deallocated 260 not deallocated 20211", 20471, 260, 20211, 485, 15, 470
|
||||
"{}", "Allocation summary allocated 19992 deallocated 251 not deallocated 19741", 19992, 251, 19741, 6, 6, 0
|
||||
"{:z 0}", "Allocation summary allocated 20029 deallocated 255 not deallocated 19774", 20029, 255, 19774, 43, 10, 33
|
||||
"{:zero 0}", "Allocation summary allocated 20107 deallocated 255 not deallocated 19852", 20107, 255, 19852, 121, 10, 111
|
||||
"{:z 0 :o 1}", "Allocation summary allocated 20066 deallocated 256 not deallocated 19810", 20066, 256, 19810, 80, 11, 69
|
||||
"{:zero 0 :one 1}", "Allocation summary allocated 20196 deallocated 259 not deallocated 19937", 20196, 259, 19937, 210, 14, 196
|
||||
"{:z 0 :o 1 :t 2}", "Allocation summary allocated 20103 deallocated 257 not deallocated 19846", 20103, 257, 19846, 117, 12, 105
|
||||
"{:zero 0 :one 1 :two 2 :three 3 :four 4 :five five :six 6 :seven 7 :eight 8 :nine 9}", "Allocation summary allocated 21164 deallocated 286 not deallocated 20878", 21164, 286, 20878, 1178, 41, 1137
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
28
unit-tests/allocation-tests/test-forms
Normal file
28
unit-tests/allocation-tests/test-forms
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
nil
|
||||
()
|
||||
(quote ())
|
||||
(list)
|
||||
(list )
|
||||
(list 1)
|
||||
(list 1 1)
|
||||
(list 1 1 1)
|
||||
(list 1 2 3)
|
||||
(+)
|
||||
(+ 1)
|
||||
(+ 1 1)
|
||||
(+ 1 1 1)
|
||||
(+ 1 2 3)
|
||||
(list 'a 'a 'a)
|
||||
(list 'a 'b 'c)
|
||||
(list :a :b :c)
|
||||
(list :aa :bb :cc)
|
||||
(list :aaa :bbb :ccc)
|
||||
(list :alpha :bravo :charlie)
|
||||
{}
|
||||
{:z 0}
|
||||
{:zero 0}
|
||||
{:z 0 :o 1}
|
||||
{:zero 0 :one 1}
|
||||
{:z 0 :o 1 :t 2}
|
||||
{:zero 0 :one 1 :two 2 :three 3 :four 4 :five five :six 6 :seven 7 :eight 8 :nine 9}
|
||||
Loading…
Add table
Add a link
Reference in a new issue