From: Bart Van Assche Date: Fri, 29 Jul 2011 07:26:01 +0000 (+0000) Subject: drd, bitmap node allocator: recognize root node size properly X-Git-Tag: svn/VALGRIND_3_7_0~296 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9e5622baf6804426000db6134d7ed232fc5a356;p=thirdparty%2Fvalgrind.git drd, bitmap node allocator: recognize root node size properly git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11941 --- diff --git a/drd/drd_bitmap2_node.c b/drd/drd_bitmap2_node.c index 3b21dd2798..9be00aa8f4 100644 --- a/drd/drd_bitmap2_node.c +++ b/drd/drd_bitmap2_node.c @@ -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)