Module Name:    src
Committed By:   rillig
Date:           Mon Dec 13 01:00:11 UTC 2021

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make: fix memory leak when evaluating ${.SUFFIXES} (since yesterday)

perl -e '
    printf(".SUFFIXES: %s\n", "x" x 224);
    printf("_:=\${.SUFFIXES}\n" x 100_000);
    printf("all:\n");
' \
| MALLOC_CONF=stats_print:true \
    ./make -r -f - 2>&1 \
| awk '/bins:/,/^ *256/ { print $1 "\t" $4}'

Roughly 100000 less allocations for bin size 16, for the variable name.


To generate a diff of this commit:
cvs rdiff -u -r1.974 -r1.975 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to