no_std support#165
Open
CrabNejonas wants to merge 30 commits into
Open
Conversation
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…9-58Z chore: release v0.4.7
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…7-05Z chore: release v0.4.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two feature flags
stdandalloc(both of which are enabled by default) allowing this crate to be used in no_std contexts such as embedded (or wasm if you want to optimize the file size really aggressively like me).This works because the basic fst query operations such as
getandcontainsactually do not allocate at all and building the actual fst can be done in a build script in most situations.stdonly really enables features that depend onio::Writewhile most of the fst functions (all construction and complex query types) are gated behindallocI made this change mostly for myself, but thought I might as well volunteer it for inclusion even though the macros and conditional includes do complicate the codebase a fair bit I think it's a neat addition.
Edit: Ah and full
no_stdmode needs nightly, bc of error in core, which shouldn't be a problem in practice since most no_std users are on nightly anyway, but I'm happy to rip that out