What happens when you compare uninitialized heap memory with nullptr in C++?

Viewed 91

As the question states, I'm trying to understand a condition that is happening in my current application.
I'm attempting to load function pointers from a DLL. The DLL is loaded using LoadLibraryA and this is successful. This DLL has multiple methods that I need access to, and the typedef of those method pointers are also available, however, they are not initialized to nullptr.
During init, I do a comparison of the method pointers with null pointers to check if they are already loaded. I saw that all of these method pointers have the value 0xbaadf00d, and wikipedia suggests ("bad food") is used by Microsoft's LocalAlloc(LMEM_FIXED) to indicate uninitialised allocated heap memory when the debug heap is used. This is also what this thread says.
So what happens when this comparison of uninitialized method pointers to null pointer is done? It would be great if someone could help me understand this.

0 Answers
Related