Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sentinel value configurable in library/std/src/sys_common/thread_local_key.rs #105359

Merged
merged 1 commit into from
Dec 29, 2022

Commits on Dec 6, 2022

  1. Make sentinel value configurable

    There are OSs that always return the lowest free value.
    The algorithm in `lazy_init` always avoids keys with the
    sentinel value.
    In affected OSs, this means that each call to `lazy_init`
    will always request two keys from the OS and returns/frees
    the first one (with sentinel value) immediately afterwards.
    
    By making the sentinel value configurable, affected OSs can
    use a different value than zero to prevent this performance
    issue.
    flba-eb committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    980065a View commit details
    Browse the repository at this point in the history