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

Clean up once code #359

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jan 5, 2022

  1. Clean up once code

    This was originally intended to just change `swap` to `compare_exchange`
    however other changes were needed too:
    
    * Load with `Release` ordering seemed wrong because if it loaded `DONE`
      before while loop it wouldn't synchronize with the storing thread.
    * There's no point in repeatedly checking if the value is `NONE` so this
      check was moved about while loop
    * Due to a mistake I wanted to inspect using `miri` but couldn't because
      of FFI call. Separating the once implementation from consumer allowed
      writing a test in pure Rust and inspect via `miri`.
    * The initializing code now skips loading the value again because it
      already knows it's initialized.
    * Orderings are now explained in the comments
    Kixunil committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    36c96a9 View commit details
    Browse the repository at this point in the history
  2. Optimize loading of preallocated context

    This caches the initialization state of preallocated context in a thread
    local variable to avoid atomics in subsequent accesses.
    Kixunil committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    5cbf5ee View commit details
    Browse the repository at this point in the history
  3. Fixed no_std fuzzing

    Accessing `std::mem` instead of `core::mem` caused fuzzing to break
    without `std`.
    Kixunil committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    beac386 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2022

  1. Revert "Optimize loading of preallocated context"

    This reverts commit 5cbf5ee.
    Kixunil committed Jan 6, 2022
    Configuration menu
    Copy the full SHA
    51f398a View commit details
    Browse the repository at this point in the history