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

Add #![no_std] support #271

Merged
merged 2 commits into from
Dec 28, 2017
Merged

Add #![no_std] support #271

merged 2 commits into from
Dec 28, 2017

Conversation

whitequark
Copy link
Contributor

Fixes #138.

This was surprisingly easy. There are essentially no meaningful changes required.

@whitequark whitequark changed the title [WIP] Add #![no_std] support Add #![no_std] support Dec 25, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.063% when pulling 8c295a7 on whitequark:master into 7025c09 on gimli-rs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.063% when pulling c3194fd on whitequark:master into 7025c09 on gimli-rs:master.

@@ -160,10 +160,44 @@
// False positives when block expressions are used inside an assertion.
#![allow(panic_params)]

#![no_std]
#![cfg_attr(feature = "nightly", feature(alloc))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this to use a nightly feature, instead of not(feature = "std") like we do elsewhere? It'd be nice if cargo build --no-default-features could work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. See Cargo.toml:

nightly = ["fallible-iterator/alloc"]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is probably nitpicky, but I just want to make sure I understand if you don't mind:

  • do we need to use fallible-iterator/alloc in gimli?
  • why don't the uses of the alloc crate depend on the nightly feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to use fallible-iterator/alloc in gimli?

Yes. Otherwise, it cannot be tested without the std feature, I believe.

Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@philipc philipc merged commit 04aa240 into gimli-rs:master Dec 28, 2017
@fitzgen
Copy link
Member

fitzgen commented Dec 29, 2017

Thanks for adding no_std support @whitequark ! Was the btreemap vs hashmap related to no_std or was it for performance? And if the latter, what kind of difference did you observe?

@whitequark
Copy link
Contributor Author

whitequark commented Dec 29, 2017

@fitzgen Just #![no_std]. There is no hash-anything without std, because they implicitly rely on the global state (the default RNG). This is actually very annoying, but oh well!

@fitzgen
Copy link
Member

fitzgen commented Dec 29, 2017

Ah, yeah that makes sense. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants