-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
no_std support? #4
Comments
Shaping and scaling unfortunately do require heap allocations due to indeterminate memory requirements or upper bounds that are too large for stack allocation. That said, the crate could be core+alloc, but certain components of the underlying path engine require floating point intrinsics that are currently unavailable in core. This is a known problem and when it is resolved, I would like to remove the std dependency. |
It doesn't seem like there's been any work towards it in the aforementioned issue for ~3 years. It might be worth feature gating it with support for libm or micromath? Not really familiar with this kind of stuff, though. Edit: Proof of Concept (I won't actually be implementing this, I'm too busy.) |
I will be attempting to add this feature. |
This commit adds a default "std" feature that can be disabled to run this crate in no_std environments. This allows for Zlib compression or decompression to happen on embedded systems. Rel: dfrg/swash#4 This is a breaking change, as anyone who is already importing yazi with "default-features = false" and using the From<io::Error> impl on yazi::Error will have their build break after this commit. Signed-off-by: John Nunley <[email protected]>
This commit adds two new features: "std" (which is enabled by default) and "libm". When "std" is enabled, floating point intrinsics are used from libstd. When "libm" is enabled, it brings in the pure Rust libm implementation to handle floating point instrinsics in software mode. By disabling the "std" feature and enabling "libm", this crate can be effectively used on no_std platforms, like embedded systems. This is a breaking change, as it adds an "std" default feature that, when disabled without enabling "libm", causes a compile error. Users who are currently using zeno with "default-features = false" without preparation will have their compilation break. Rel: dfrg/swash#4 Signed-off-by: John Nunley <[email protected]>
@jackpot51 Are you on this? It does seem like it'll be a while before math-in-core is stable. I think it would certainly be worth using something like As for
|
I was working on it but got distracted by other things. I can take another crack at it if it's important to you. |
I was actually thinking about using swash for early console rendering inside of my OS, so I'd love it if you could add support. I can also try to help out with anything, as I have lots of experience with no_std (see said OS). |
Thanks to @notgull, all dependencies should support no_std now. Doing so for swash is mostly grunt work that involves integrating libm and importing alloc::vec::Vec where required. I don’t really have time to do it myself but I’m happy to accept a PR. |
Something I've seen in a lot of other crates is simply |
Wow, I totally forgot about this. I'd love to try to get something like that done this week, if the story is still the same. |
Will this library ever add
no_std
support?I ask because it's not in the Non Goals section of the README, yet it does not appear to have any allocations or use any features from libstd.
The text was updated successfully, but these errors were encountered: