Skip to content

Commit

Permalink
Further improve comments in libstd/panicking.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardosm committed Jul 2, 2020
1 parent aac2f73 commit 0f1adc8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libstd/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ pub mod panic_count {
// (including the current one) will have `LOCAL_PANIC_COUNT`
// equal to zero, so TLS access can be avoided.
//
// A relaxed atomic load is equivalent to a normal aligned memory read
// (e.g., a `mov` instruction in x86), while a TLS access might require
// calling a non-inlinable function (such as `__tls_get_addr` when using
// the GD TLS model).
// In terms of performance, a relaxed atomic load is similar to a normal
// aligned memory read (e.g., a mov instruction in x86), but with some
// compiler optimization restrictions. On the other hand, a TLS access
// might require calling a non-inlinable function (such as `__tls_get_addr`
// when using the GD TLS model).
true
} else {
is_zero_slow_path()
Expand Down

0 comments on commit 0f1adc8

Please sign in to comment.