RFC: Replacing the default CRT allocator on Windows

I couldn’t tell you offhand, and a quick google search does not turn up a comparison. However, one obvious advantage of the debug heap vs address sanitizer is that the debug heap Just Works out of the box with no configuration. I prefer to use the builtin tools as much as possible because I find that integrating a bunch of random external stuff tends to be brittle and have little sharp edges here and there. Address Sanitizer is certainly better than nothing, but Windows has a built in instrumented malloc that just works, and works well. Ideally it remains available.

Realistically, we used the system allocator, and it was found wanting. So now somebody is going to do the work to use a custom allocator. Since we had to change the allocator once, we may have to do it again. One size does not fit all, so we probably want different allocators on different platforms. Just using the system allocator should be a first-class option. Since supporting N custom allocators means N different build configurations, I’d like to see the windows allocator remain the default in some configuration to ensure that it doesn’t bitrot.


Christopher Tetreault