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.
CプログラミングコードにXCode 4.6 Allocation instrumentを使用しようとしました:
#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のAllocationsインスツルメントがプログラムのリリースバージョンを処理していたため、コードが最適化されたことでした。
解決策は、プロファイルオプションに「リリース」ではなく「デバッグ」モードを選択することです。