| Re: Extra HeapAlloc entry 0x1800 bytes |
|
 |
|
 |
|
 |
|
 |
Group: comp.os.mswindows.programmer.memory · Group Profile
Author: Sten Westerback (MVP SDK 2005-6 :)Sten Westerback (MVP SDK 2005-6 :) Date: Apr 2, 2008 11:52
> 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);
> }
> }
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
|