I am trying to understand the heap, and the allocation deallocation and related, but all examples I seem to find use examples such as
Which is the best one I have seen cause to my knowledge "MAX( 16, nSize + 1))" would mean "To choose which is greater? 16? or SIZEOF(datatype)"
The problem being, I do NOT like hardcoded values with no explanation of what the value means. So I have to ask
I am sure its in the docs somewhere, but either I am having a CNDS
or just not understanding, so hopefully someone can explain it???
FUNCTION = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, MAX( 16, nSize + 1))
The problem being, I do NOT like hardcoded values with no explanation of what the value means. So I have to ask
- Why 16? (some minimum value? or what is the real equates?)
- nSize (obvious from examples is the size) but why the add one? (I can only guess for an added null, or a zero-vs-one based concept or something
I am sure its in the docs somewhere, but either I am having a CNDS

Comment