3 ms·
> The safety checks have uncovered over 1,000 bugs In most implementations of the standard library, safety checks can be enabled with a simple #define. In some
by DLoupe 2y ago
> The safety checks have uncovered over 1,000 bugs
In most implementations of the standard library, safety checks can be enabled with a simple #define. In some, it's the default behavior in DEBUG mode. I wonder what this library improves on that and why these bugs have not been discovered before.
- dataflow 2y agoIt's a great question (_LIBCPP_DEBUG was already a thing in libc++), and AFAIK the answer is supposedly "it used to be too costly to enable these in production with libc++, and it no longer is." I have no first-hand insight as to how accurate this perception is.
- alpire 2y agoThat's exactly right. We've had extra hardening enabled in tests, and that does catch many issues. But tests can't exercise every potential out-of-bounds issue, which is why enabling it prod enabled us to find & fix additional issues.
- pjmlp 2y agoBeing actually enforced, even in release. Most folks don't use those #defines, and many still haven't leaned about them.
- saagarjha 2y agoThey turned those on and 1. checked that the software using it didn't break and 2. made sure it didn't tank performance. Source: I worked on this apparently