]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Fix reads and writes counts in DHAT.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 7 May 2020 01:50:55 +0000 (11:50 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Thu, 7 May 2020 22:40:19 +0000 (08:40 +1000)
commit968bddcd4b4a6565fcd120523c7b33bfd77b5c65
treefe6e4eb73e128c179fb42ed9faec10cfbda47062
parent4bed5a4a0a433278b344a5a54f12ca38b36b48dc
Fix reads and writes counts in DHAT.

If you do `malloc(100)` followed by `realloc(200)`, DHAT now adds 100
bytes to the read and write counts for the implicit `memcpy`. This gives
more reasonable results.

I have long been surprised by low writes-per-byte values of around 0.35
for vectors that are grown by doubling. Counting the implicit `memcpy`
increases those numbers to well above 0.5, which is what you'd expect.

The commit also adds a section to the DHAT docs about `realloc`, because
there is some non-obvious behaviour, some of which confused me just a
couple of days ago.
NEWS
dhat/dh_main.c
dhat/docs/dh-manual.xml
dhat/tests/basic.c
dhat/tests/basic.stderr.exp