Disable allocation pooling when AddressSanitizer is enabled #264
+30
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allocation pooling obscures whether or not memory is freed or not from AddressSanitizer, making it less useful.
With this patch, the game works same as it ever was, but AddressSanitizer now properly finds some errors that previously would only trigger spurious really cryptic UndefinedBehaviorSanitizer errors.
I suspect these cryptic errors have the exact same root causes as what causes random memory corruption crashes the development branch has. Being able to use ASan to find them is an important step in fixing these, I think.
An alternative would be to, instead of doing this, use ASan's API to poison/unpoison memory. However, the functions to do that require an allocation size to be provided, and the memory pooling functions don't get those.
An alternative to the address sanitizer detection concoction that this patch has would be to check for
DEBUGMODEinstead, but I figured it's better to leave pooling enabled for that in case someone is building with debug mode specifically to debug that lol