// set the free block mem to a released value
memset( ((u8*)pFree) + sizeof(MemHeapFree),
MEMHEAP_RELEASED_MEM,
pFree->uSize - sizeof(sizeof(MemHeapFree)) );
See it? See the sizeof(sizeof(expression))? I just had a massive WTF moment when I saw that while stepping through the code.
So, this thread is for any other things in C, C++ or any other languages that you think other people would find strange, amusing or unbelievable.
Oh, and for anyone that's interested, the sizeof(sizeof(x)) comes out to 4, which I guess is expected once you know the compiler actually accepts it.






