]> git.ipfire.org Git - thirdparty/valgrind.git/commit
This commit reduces the overhead of each heap allocation done by
authorNicholas Nethercote <njn@valgrind.org>
Wed, 20 Jul 2005 04:12:41 +0000 (04:12 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 20 Jul 2005 04:12:41 +0000 (04:12 +0000)
commit6be8d5392289a3251892d5f54c54a11f774ef8e1
treee0989706fce1128bac44061bf470edcbb873ae09
parent7d2702cc92696417c2d6d9afd828040aceec4474
This commit reduces the overhead of each heap allocation done by
Valgrind's allocator, by overlapping the redzones (used when blocks
are in-use) with the prev/next ptrs (used when they are free).
This reduces the overhead for a heap block allocated by the core from
32B to 16B on 32 bit machines, and from 48B to 32B on 64 bit machines.

The only conceivable downside of this is that on 64 bit machines, if
the client frees a block and then writes past the start/end of it,
it will corrupt the metadata after only 8 bytes of overwriting, rather than
16 bytes.  Memcheck will have squealed to kingdom come by this time anyway.
(This won't happen on 32 bit machines because the overhead hasn't changed
for client blocks as allocated by Memcheck on 32 bit machines.)

I also tweaked the access functions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4208
coregrind/m_mallocfree.c