Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extra HeapAlloc entry 0x1800 bytes

10 views
Skip to first unread message

Paul Sinnett

unread,
Jan 24, 2008, 5:00:06 AM1/24/08
to
If I create a new heap with HeapCreate and then walk it with HeapWalk
it reports an entry of 6144 bytes (0x1800). What is this block for?

HANDLE hHeap = HeapCreate(0, 5*1024*1024, 0);

PROCESS_HEAP_ENTRY entry;
entry.lpData = NULL;
TRACE("Mem Heap Dump\n");
TRACE(" Address Size\n");
TRACE("----------------\n");
while (HeapWalk(hHeap, &entry))
{
if (entry.wFlags & PROCESS_HEAP_ENTRY_BUSY)
{
TRACE(" %p %8d\n", entry.lpData, entry.cbData);
}
}

Sten Westerback (MVP SDK 2005-6 :)

unread,
Apr 2, 2008, 2:52:04 PM4/2/08
to

"Paul Sinnett" <paul.s...@gmail.com> wrote in message
news:93706688-3a64-4aa3...@h11g2000prf.googlegroups.com...

A quick guess: the additional memory block is used to maintain information
about what the heap contains.
BTW. Are you sure you need HeapCreate and can't just use GetProcessHeap() ?
Or some other memory allocation (LocalAlloc, GlobalAlloc, malloc, calloc,
new, ...)...

- Sten


0 new messages