|
From: Mark W. <ma...@kl...> - 2020-05-11 07:49:41
|
Hi Nicholas, On Thu, 2020-05-07 at 22:40 +0000, Nicholas Nethercote wrote: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=968bddcd4b4a6565fcd120523c7b33bfd77b5c65 > > commit 968bddcd4b4a6565fcd120523c7b33bfd77b5c65 > Author: Nicholas Nethercote <nne...@mo...> > Date: Thu May 7 11:50:55 2020 +1000 > > 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. Note that valgrind 3.16.0 just branched. Should this commit also go on the branch before the 3.16.0 release? Thanks, Mark |