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

crate: add 'alloc' feature #127

Merged
merged 3 commits into from
Jul 11, 2023
Merged

crate: add 'alloc' feature #127

merged 3 commits into from
Jul 11, 2023

Commits on Jul 11, 2023

  1. crate: add 'alloc' feature

    This crate currently only has a 'std' feature and of course support for
    no-std. But in that mode, it was also no-alloc. In practice, this crate
    is virtually all core-only, that is, no-std and no-alloc. There are
    really only a few parts that want std or alloc. For std, runtime CPU
    feature detection requires it. For alloc, there are a few minor APIs
    that require allocation.
    
    Previously, the only way to get the APIs that require allocation was to
    enable 'std'. This new feature permits getting those APIs without
    bringing in 'std'.
    
    I don't expect this to unlock any new or interesting use cases, but it
    will make downstream configurations a little more sensible and less
    annoying.
    
    Fixes #121
    BurntSushi committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    25405d7 View commit details
    Browse the repository at this point in the history
  2. impl: improve FindIter

    Basically, use `?` to pretty massively simplify `next`. And also add a
    `size_hint` method based on some sensible constraints.
    
    Closes #123
    Lucretiel authored and BurntSushi committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    6852d74 View commit details
    Browse the repository at this point in the history
  3. impl: add compile time cpu feature detection when no_std

    This permits one to run the AVX memchr routines on x86-64 even when
    'std' is not enabled. Probably something similar should be done for
    memmem, but I think I have to insist on its conditional compilation
    being simplified/centralized first.
    
    Closes #120
    MarcusGrass authored and BurntSushi committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    b4a4c6a View commit details
    Browse the repository at this point in the history