forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#68164 - tmiasko:no-sanitize, r=nikomatsakis
Selectively disable sanitizer instrumentation Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
- Loading branch information
Showing
20 changed files
with
279 additions
and
29 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/doc/unstable-book/src/language-features/no-sanitize.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# `no_sanitize` | ||
|
||
The tracking issue for this feature is: [#39699] | ||
|
||
[#39699]: https://github.com/rust-lang/rust/issues/39699 | ||
|
||
------------------------ | ||
|
||
The `no_sanitize` attribute can be used to selectively disable sanitizer | ||
instrumentation in an annotated function. This might be useful to: avoid | ||
instrumentation overhead in a performance critical function, or avoid | ||
instrumenting code that contains constructs unsupported by given sanitizer. | ||
|
||
The precise effect of this annotation depends on particular sanitizer in use. | ||
For example, with `no_sanitize(thread)`, the thread sanitizer will no longer | ||
instrument non-atomic store / load operations, but it will instrument atomic | ||
operations to avoid reporting false positives and provide meaning full stack | ||
traces. | ||
|
||
## Examples | ||
|
||
``` rust | ||
#![feature(no_sanitize)] | ||
|
||
#[no_sanitize(address)] | ||
fn foo() { | ||
// ... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.