Skip to content

Mark initialization of OnceRef::get_or_try_init cold.#285

Merged
matklad merged 1 commit intomatklad:masterfrom
briansmith:b/once-ref-cold
Mar 28, 2025
Merged

Mark initialization of OnceRef::get_or_try_init cold.#285
matklad merged 1 commit intomatklad:masterfrom
briansmith:b/once-ref-cold

Conversation

@briansmith
Copy link
Contributor

@briansmith briansmith commented Mar 28, 2025

Use Self::get() instead of directly loading the value, which is a DRY improvement in its own right.

Then it is trivial to split out the initialization into a #[cold] function, matching the other implementations in the module.

This is the OnceRef analog of commit 90da60b.

Use `Self::get()` instead of directly loading the value, which is a
DRY improvement in its own right.

Then it is trivial to split out the initialization into a `#[cold]`
function, matching the other implementations in the module.

This is the `OnceRef` analog of
commit 90da60b.
@matklad matklad merged commit 01b1d56 into matklad:master Mar 28, 2025
1 check passed
@briansmith briansmith deleted the b/once-ref-cold branch March 31, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants