Windows NT Heap Alignment on 64-bit Systems
I am trying to develop my own heap for an IoT platform, which is supposed to be an equivalent NT heap of Windows for my masters degree.
From what I've seen, it appears like the NT Heap header on 64-bit systems seems to be 8 bytes long.
Whenever I allocate a chunk it seems like the address returned is divisible by 0x10. My first question is why is it divisible by 16? From what I've researched on Linux, it seems like other Heaps usually align to 8 bytes so it would be divisible by the size of pointer.
In addition, can the NT heap ever "break" this alignment and behave differently? Especially if I have reached a state where there is a lot of internal fragmentation? Will it ever align to 8? or to anything else?
I've tried to search for the answer online but I couldn't find a clear answer and wish to succeed in this task.