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.
我尝试将 XCode 4.6 分配工具用于 C 编程代码:
#include <stdlib.h> int main(void){ char c[5] = "Hello"; unsigned char *p; p = (unsigned char *) malloc(sizeof(p)); *p = 255; return 0; }
但它没有显示任何分配:
为什么?
谢谢 2cnicutar
问题是 XCode 4.6 的分配工具正在处理程序的发布版本,因此代码进行了优化。
解决方案是为 Profile 选项选择“Debug”模式而不是“Release”