Debug heap/STL debugging equivalent for GCC?

后端 未结 5 1494
梦谈多话
梦谈多话 2021-01-12 20:11

I plan on using GCC more (Linux and Windows) and I was wondering if there\'s an equivalent of the MSVC debug heap and the STL checks available for the GCC CRT and STL.

5条回答
  •  生来不讨喜
    2021-01-12 20:52

    What you're looking for can be enabled by defining _GLIBCXX_DEBUG before including any standard libraries. I'm not sure what affects this will have if you can't use it consistently. My default advice would be to be very careful. Also I've heard that the debug checks can be a big performance hit. So big that it may be unwise to always have it enabled for debug builds.

提交回复
热议问题