Enable Guard Malloc on Mac

Xcode has this nice debugging feature called 'Enable Guard Malloc', which is settable from Edit Schemes - Diagnostics (among a few other tools that I don't use as often). I just figured out, from the libgmalloc man page, that I can enable it when debugging with CLion by adding the following environment variable when editing the Run/Debug Configurations:

DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib

I've made a note so that I can use this in the future, but what about adding it as an option within the IDE?  You usually only want it on for a brief amount of time when debugging some memory-related crash, although it is difficult to remember what to type here if you have to enable it manually. Just a thought.

cheers,
Rich

0
2 comments

Hi Rich.

We have the issue in the tracker: https://youtrack.jetbrains.com/issue/OC-3534. Feel free to comment or upvote!

0
Avatar
Permanently deleted user

Thanks! Moved my feature request there.

0

Please sign in to leave a comment.