mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 10:21:20 +00:00
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.
6 lines
151 B
Plaintext
6 lines
151 B
Plaintext
Total: 7,000 bytes in 4 blocks
|
|
At t-gmax: 5,000 bytes in 2 blocks
|
|
At t-end: 3,000 bytes in 1 blocks
|
|
Reads: 3,008 bytes
|
|
Writes: 3,516 bytes
|