Skip to content

Commit

Permalink
Auto merge of #107329 - joboet:optimize_lazylock, r=m-ou-se
Browse files Browse the repository at this point in the history
Optimize `LazyLock` size

The initialization function was unnecessarily stored separately from the data to be initialized. Since both cannot exist at the same time, a `union` can be used, with the `Once` acting as discriminant. This unfortunately requires some extra methods on `Once` so that `Drop` can be implemented correctly and efficiently.

`@rustbot` label +T-libs +A-atomic
  • Loading branch information
bors committed Feb 18, 2023
2 parents c0a9453 + ab299bd commit 663260f
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 663260f

Please sign in to comment.