Jacek Caban : dbghelp: Improved arena allocation in pool_alloc.

Alexandre Julliard julliard at winehq.org
Fri Aug 14 09:01:17 CDT 2009


Module: wine
Branch: master
Commit: 4e1a4ecc04e37c7621de2582d7e2fc0af0a22909
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4e1a4ecc04e37c7621de2582d7e2fc0af0a22909

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Aug 14 14:51:09 2009 +0200

dbghelp: Improved arena allocation in pool_alloc.

---

 dlls/dbghelp/storage.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/dbghelp/storage.c b/dlls/dbghelp/storage.c
index 4e62f11..c7f06cc 100644
--- a/dlls/dbghelp/storage.c
+++ b/dlls/dbghelp/storage.c
@@ -108,13 +108,13 @@ void* pool_alloc(struct pool* pool, size_t len)
         }
     }
 
-    size = max( pool->arena_size, len + sizeof(struct pool_arena) );
-    arena = HeapAlloc(GetProcessHeap(), 0, size);
+    size = max( pool->arena_size, len );
+    arena = HeapAlloc(GetProcessHeap(), 0, size + sizeof(struct pool_arena));
     if (!arena) return NULL;
 
     ret = arena + 1;
     arena->current = (char*)ret + len;
-    arena->end = (char *)arena + size;
+    arena->end = (char*)ret + size;
     if (arena->current + 16 >= arena->end)
         list_add_tail( &pool->arena_full, &arena->entry );
     else




More information about the wine-cvs mailing list