Is it possible to take a heap handle from HeapCreate() and set all available memory to a certain value?
I've tried enumerating the heap by region and setting it that way, but I get access violations.
I basically want to set the memory in my heap to a custom value that I can use for debugging, before it's ultimately destroyed via HeapDestroy.
The short answer is "no, you can't fill the heap with a specific value".
You could wrap your heap access functions with debug versions, for example
I have just typed all that in, so there may be minor typos, but hopefully it shows you a method of dealing with memory allocations. For some case, you may have to pad the
extra
struct to be a multiple of 16 or 32 bytes to ensure alignment of the following data. You can of course, at any time, dump the linked list pointed to byhead
, to see what is allocated.