-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add naive first implementation of per-allocator disablement of ASan #5241
base: main
Are you sure you want to change the base?
[WIP] Add naive first implementation of per-allocator disablement of ASan #5241
Conversation
stl/inc/vector
Outdated
@@ -493,6 +493,10 @@ private: | |||
return; | |||
} | |||
|
|||
if (!is_ASan_enabled_for_allocator_v<allocator_type>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is testing a constant expression, it should probably be an if constexpr
containing the entire function body so we don't bother to so much as compile it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr
'ed all the things: 71c7716
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's better to write
if constexpr (is_ASan_enabled_for_allocator_v<allocator_type>) {
// ASan stuffs
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought about that as well. In this case we're inside the _Apply_annotation
method which, to my understanding, is already ASan-specific. I figure we wouldn't want to indent all of the remaining code to be inside the if
-statement.
Do let me know if I'm misunderstanding something though :-)
Co-authored-by: Casey Carter <[email protected]>
Co-authored-by: Casey Carter <[email protected]>
This is a WIP, opening for visibility and checkpointing only.