【发布时间】:2010-11-23 19:53:18
【问题描述】:
在 Windows 中,当我导入 ctypes 模块时,ctypes.cdll.msvcrt 对象自动存在,它代表msvcrt Microsoft C++ 运行时库according to the docs。
但是,我注意到还有一个 find_msvcrt 函数将 "return the filename of the VC runtype library used by Python"。
它进一步指出,"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."
所以我的问题是,我已经拥有的 ctypes.cdll.msvcrt 库与我可以使用 find_msvcrt 函数加载的库之间有什么区别?在什么特定情况下它们可能不是同一个库?
【问题讨论】: