]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add info about overhead in heap blocks and OSet nodes.
authorNicholas Nethercote <njn@valgrind.org>
Fri, 16 Dec 2005 17:06:37 +0000 (17:06 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 16 Dec 2005 17:06:37 +0000 (17:06 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5361

coregrind/m_mallocfree.c
coregrind/m_oset.c

index d975f0879ddb92d4ecc95dda20c15cde76431ca5..b2a1029accb38c9fc56f15480a8cc725b775986f 100644 (file)
@@ -80,6 +80,15 @@ typedef UChar UByte;
 
       bszB == pszB + 2*sizeof(SizeT) + 2*a->rz_szB
 
+   The minimum overhead per heap block for arenas used by
+   the core is:   
+
+      32-bit platforms:  2*4 + 2*4 == 16 bytes
+      64-bit platforms:  2*8 + 2*8 == 32 bytes
+
+   In both cases extra overhead may be incurred when rounding the payload
+   size up to VG_MIN_MALLOC_SZB.
+
    Furthermore, both size fields in the block have their least-significant
    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 alignment.)
index 695d45d9b1482f5b1b744f1458e7b03a782a92d2..0730ac60ddc80fdcdf1fbfdd69dd36ffb2e74afd 100644 (file)
@@ -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 because 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.