diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 22:18:07 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 22:18:07 -0600 |
| commit | f561301b7ee805a223ba8eb9cc7081ec9bb5aa80 (patch) | |
| tree | 8b84a025d4aed21391bcdd2fde65391898f54446 | |
| parent | a1cf90eb067effe8a7c85f5d2024a0c3d22817e1 (diff) | |
| download | ztop-f561301b7ee805a223ba8eb9cc7081ec9bb5aa80.tar.gz | |
leakcheck: awk wants -f, and its z/OS build wants no comments
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | tests/leak.awk | 18 |
2 files changed, 3 insertions, 17 deletions
@@ -54,7 +54,7 @@ TESTFLAGS = -std=c17 -g -O1 -Wall -Wextra -Wshadow -Wpedantic \ # allocated and never freed. HEAPCHK(ON) additionally walks the heap at # every call, so a double free or an overlay abends instead of hiding. LEAKDIR = $(HOME)/tmp/ztop/leak -LEAKAWK = tests/leak.awk +LEAKAWK = -f tests/leak.awk all: @(uname -s | grep OS/390 > /dev/null) || \ diff --git a/tests/leak.awk b/tests/leak.awk index f68c05e..f1c6f31 100644 --- a/tests/leak.awk +++ b/tests/leak.awk @@ -1,39 +1,25 @@ -# Read the storage report Language Environment writes at termination -# (RPTSTG(ON)) and fail when the heap was not given back: a get without -# its free, or a created heap without its discard, is a leak. -# -# awk -f tests/leak.awk < storage-report - /^(HEAP|HEAP24|ANYHEAP|BELOWHEAP|THREADHEAP|Additional Heap) statistics:/ { inheap = 1 } - /^End of Storage Report/ { inheap = 0 } - inheap && /^Successful Get Heap requests:/ { get += $NF } - inheap && /^Successful Free Heap requests:/ { fre += $NF } - inheap && /^Successful Create Heap requests:/ { cre += $NF } - inheap && /^Successful Discard Heap requests:/ { dis += $NF } - END { if (get != fre || cre != dis) { - printf "LEAK: gets %d frees %d, create %d discard %d\n", get, fre, - cre, dis + printf "LEAK: gets %d frees %d, create %d discard %d\n", get, fre, cre, dis exit 1 } - printf "heap gets %d frees %d, create %d discard %d\n", get, fre, cre, - dis + printf "heap gets %d frees %d, create %d discard %d\n", get, fre, cre, dis } |
