]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd, bitmap node allocator: recognize root node size properly
authorBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 07:26:01 +0000 (07:26 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 29 Jul 2011 07:26:01 +0000 (07:26 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11941

drd/drd_bitmap2_node.c

index 3b21dd27985209d2e9aa72fb2b4cc1fa9bdbe008..9be00aa8f426d989b191b5b0e6f5aa9f83abd3bc 100644 (file)
@@ -56,6 +56,7 @@ struct block_allocator_chunk {
 
 /* Local variables. */
 
+static SizeT s_root_node_size;
 static SizeT s_bm2_node_size;
 static struct block_allocator_chunk* s_first;
 
@@ -120,7 +121,9 @@ void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB)
     * allocate an AVL tree root node. Otherwise it has been called to allocate
     * an AVL tree branch or leaf node.
     */
-   if (szB < sizeof(struct bitmap2))
+   if (s_root_node_size == 0)
+      s_root_node_size = szB;
+   if (szB == s_root_node_size)
       return VG_(malloc)(ec, szB);
 
    while (True)