Skip to content

Commit

Permalink
Clarify note in std::sync::LazyLock example
Browse files Browse the repository at this point in the history
  • Loading branch information
AeonSolstice authored Jan 15, 2025
1 parent 27f3361 commit c4a5e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sync/lazy_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ union Data<T, F> {
/// ```
/// use std::sync::LazyLock;
///
/// // n.b. static items do not call [`Drop`] on program termination, so this won't be deallocated.
/// // Note: static items do not call [`Drop`] on program termination, so this won't be deallocated.
/// // this is fine, as the OS can deallocate the terminated program faster than we can free memory
/// // but tools like valgrind might report "memory leaks" as it isn't obvious this is intentional.
/// static DEEP_THOUGHT: LazyLock<String> = LazyLock::new(|| {
Expand Down

0 comments on commit c4a5e12

Please sign in to comment.