Valgrind like tool on Mac OS 10.7 (Lion)

后端 未结 2 1055
时光取名叫无心
时光取名叫无心 2021-01-02 12:40

I need a tool which helps me to find memory leaks in a c program in a similar way valgrind does. It should figures out when a program overwrites memory it should not (e.g. b

相关标签:
2条回答
  • 2021-01-02 13:09

    I would use the XCode developer tool MallocDebug. You should have this installed with XCode in your /Developer folder

    Alternatively, you can run your application in gdb and use the native malloc logging by running

    % gdb <program name>
    (gdb) set env MallocStackLoggingNoCompact 1
    (gdb) run
    

    Then, you can use /usr/bin/leaks and /usr/bin/malloc_history to find obvious leaks

    0 讨论(0)
  • 2021-01-02 13:23

    Valgrind 3.7.0 (released 5th November 2011) supports Lion. http://valgrind.org

    0 讨论(0)
提交回复
热议问题