|
From: <sv...@va...> - 2005-12-16 17:06:44
|
Author: njn
Date: 2005-12-16 17:06:37 +0000 (Fri, 16 Dec 2005)
New Revision: 5361
Log:
Add info about overhead in heap blocks and OSet nodes.
Modified:
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_oset.c
Modified: trunk/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_mallocfree.c 2005-12-16 16:10:48 UTC (rev 5360)
+++ trunk/coregrind/m_mallocfree.c 2005-12-16 17:06:37 UTC (rev 5361)
@@ -80,6 +80,15 @@
=20
bszB =3D=3D pszB + 2*sizeof(SizeT) + 2*a->rz_szB
=20
+ The minimum overhead per heap block for arenas used by
+ the core is: =20
+
+ 32-bit platforms: 2*4 + 2*4 =3D=3D 16 bytes
+ 64-bit platforms: 2*8 + 2*8 =3D=3D 32 bytes
+
+ In both cases extra overhead may be incurred when rounding the payloa=
d
+ size up to VG_MIN_MALLOC_SZB.
+
Furthermore, both size fields in the block have their least-significa=
nt
bit set if the block is not in use, and unset if it is in use.
(The bottom 3 or so bits are always free for this because of alignmen=
t.)
Modified: trunk/coregrind/m_oset.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_oset.c 2005-12-16 16:10:48 UTC (rev 5360)
+++ trunk/coregrind/m_oset.c 2005-12-16 17:06:37 UTC (rev 5361)
@@ -42,7 +42,8 @@
// - First is the AVL metadata, which is three words: a left pointer, a
// right pointer, and a word containing balancing information and a
// "magic" value which provides some checking that the user has not
-// corrupted the metadata.
+// corrupted the metadata. So the overhead is 12 bytes on 32-bit
+// platforms and 24 bytes on 64-bit platforms.
// - Second is the user's data. This can be anything. Note that becaus=
e it
// comes after the metadata, it will only be word-aligned, even if the
// user data is a struct that would normally be doubleword-aligned.
|