In Windows, the ctypes.cdll.msvcrt
object automatically exists when I import the ctypes module, and it represents the msvcrt
Microsoft C++ runtime library according to the docs.
However, I notice that there is also a find_msvcrt function which will "return the filename of the VC runtype library used by Python"
.
It further states, "If you need to free memory, for example, allocated by an extension module with a call to the free(void *), it is important that you use the function in the same library that allocated the memory."
So my question is, what's the difference between the ctypes.cdll.msvcrt
library that I already have and the one which I can load with the find_msvcrt
function? Under what specific circumstances might they not be the same library?