Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Windows 上尝试一下 TCMalloc。我已经构建了 VisualStudio 解决方案,它是我下载的 gperftools 包的一部分。但是,当我运行下载时附带的任何测试应用程序时,例如 tcmalloc_minimal_unittest.exe,所有内存分配调用都转到标准 malloc。有没有人已经看过这个并且知道我应该怎么做?非常感谢。
好的,我回答我自己的问题。这可能对其他人有用。我在 VS 调试器上看到调用了 CRT malloc,但查看汇编代码我看到函数的开头已修补,显示跳转到 Perftools_malloc。因此,显然,TCMalloc 不是提供不同的 API,而是挂钩到对 CRT 的常规调用。