|
From: <sv...@va...> - 2011-07-29 07:30:50
|
Author: bart
Date: 2011-07-29 08:26:01 +0100 (Fri, 29 Jul 2011)
New Revision: 11941
Log:
drd, bitmap node allocator: recognize root node size properly
Modified:
trunk/drd/drd_bitmap2_node.c
Modified: trunk/drd/drd_bitmap2_node.c
===================================================================
--- trunk/drd/drd_bitmap2_node.c 2011-07-29 07:22:29 UTC (rev 11940)
+++ trunk/drd/drd_bitmap2_node.c 2011-07-29 07:26:01 UTC (rev 11941)
@@ -56,6 +56,7 @@
/* 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 @@
* 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)
|