Re: Extra HeapAlloc entry 0x1800 bytes
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.memory only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Extra HeapAlloc entry 0x1800 bytes         

Group: comp.os.mswindows.programmer.memory · Group Profile
Author: Sten Westerback (MVP SDK 2005-6 :)
Date: Apr 2, 2008 11:52

"Paul Sinnett" gmail.com> wrote in message
news:93706688-3a64-4aa3-88c7-4a56544c5bbc@h11g2000prf.googlegroups.com...
> 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
no comments
diggit! del.icio.us! reddit!

RELATED THREADS
SubjectArticles qty Group
Re: sh reads byte by bytemuc.lists.netbsd.tech.userlevel ·