ã¾ãã¯Linuxã®ç°å¢å¤æ°ã®è¨å®ããï¼ï¼ï¼ $> export MALLOC_TRACE="log file name" 次ã«ã½ã¼ã¹ã³ã¼ãã®ç·¨é â ãããã®ã¤ã³ã¯ã«ã¼ã #include <mcheck.h> 次ã«ã½ã¼ã¹ã«ã¡ã¢ãªãã§ãã¯ããé¨åã«ä»¥ä¸ã®ã³ã¼ãã追å mtrace();âã¡ã¢ãªãã§ãã¯éå§ muntrace();âã¡ã¢ãªãã§ãã¯çµäº â å®è¡ 以ä¸ã®ãããªã³ã¼ããå®è¡ãã int main () { mtrace(); char* test = new char[10]; test = new char[10]; delete[] test; Test t = new Test (); muntrace(); } â çµæ ãããå®è¡ããã¨ä»¥ä¸ã®ãããªãã°ãæå®ãããã°ãã¡ã¤ã«ã« è¨è¿°ããã¾ããï¼å®éã«ã¯å¤ãªã©ã¯éãã¾ãï¼ = Start @ /usr
{{#tags}}- {{label}}
{{/tags}}