Skip to content

Commit 0f1adc8

Browse files
committed
Further improve comments in libstd/panicking.rs.
1 parent aac2f73 commit 0f1adc8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libstd/panicking.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,11 @@ pub mod panic_count {
264264
// (including the current one) will have `LOCAL_PANIC_COUNT`
265265
// equal to zero, so TLS access can be avoided.
266266
//
267-
// A relaxed atomic load is equivalent to a normal aligned memory read
268-
// (e.g., a `mov` instruction in x86), while a TLS access might require
269-
// calling a non-inlinable function (such as `__tls_get_addr` when using
270-
// the GD TLS model).
267+
// In terms of performance, a relaxed atomic load is similar to a normal
268+
// aligned memory read (e.g., a mov instruction in x86), but with some
269+
// compiler optimization restrictions. On the other hand, a TLS access
270+
// might require calling a non-inlinable function (such as `__tls_get_addr`
271+
// when using the GD TLS model).
271272
true
272273
} else {
273274
is_zero_slow_path()

0 commit comments

Comments
 (0)