-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add no_std support to bevy_tasks
#15464
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
Merged
alice-i-cecile
merged 13 commits into
bevyengine:main
from
bushrat011899:NoSTDBevyTasksV2
Dec 6, 2024
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ce23a44
Minor fixes for `bevy_utils` in `no_std`
bushrat011899 905c127
Initial `no_std` support in `bevy_tasks`
bushrat011899 f44c9a6
Expected `dead_code` doesn't apply to MacOS
bushrat011899 55d11e0
Merge remote-tracking branch 'upstream/main' into NoSTDBevyTasksV2
bushrat011899 7134a99
Merge remote-tracking branch 'upstream/main' into NoSTDBevyTasksV2
bushrat011899 b98cfa5
Reset Branch
bushrat011899 f2160ba
Use `edge-executor` to offer `no_std` support in `bevy_tasks`
bushrat011899 1d74b75
Taplo!
bushrat011899 f54d306
Feedback from Reviewers
bushrat011899 72a31da
Merge remote-tracking branch 'upstream/main' into NoSTDBevyTasksV2
bushrat011899 b125707
Remove duplicate entry in `check-compile-no-std`
bushrat011899 b1c3b75
Added documentation to the remaining public items in `bevy_tasks`
bushrat011899 7ed55db
Clippy!
bushrat011899 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| pub use async_task::Task; | ||
| use core::{ | ||
| fmt, | ||
| panic::{RefUnwindSafe, UnwindSafe}, | ||
| }; | ||
| use derive_more::{Deref, DerefMut}; | ||
|
|
||
| #[cfg(feature = "multi_threaded")] | ||
| pub use async_task::FallibleTask; | ||
|
|
||
| #[cfg(feature = "async_executor")] | ||
| type ExecutorInner<'a> = async_executor::Executor<'a>; | ||
|
|
||
| #[cfg(feature = "async_executor")] | ||
| type LocalExecutorInner<'a> = async_executor::LocalExecutor<'a>; | ||
|
|
||
| #[cfg(all(not(feature = "async_executor"), feature = "edge_executor"))] | ||
| type ExecutorInner<'a> = edge_executor::Executor<'a, 64>; | ||
|
|
||
| #[cfg(all(not(feature = "async_executor"), feature = "edge_executor"))] | ||
| type LocalExecutorInner<'a> = edge_executor::LocalExecutor<'a, 64>; | ||
|
|
||
| #[derive(Deref, DerefMut, Default)] | ||
| pub struct Executor<'a>(ExecutorInner<'a>); | ||
|
|
||
| #[derive(Deref, DerefMut, Default)] | ||
| pub struct LocalExecutor<'a>(LocalExecutorInner<'a>); | ||
|
|
||
| impl Executor<'_> { | ||
| #[allow(dead_code, reason = "not all feature flags require this function")] | ||
| pub const fn new() -> Self { | ||
| Self(ExecutorInner::new()) | ||
| } | ||
| } | ||
|
|
||
| impl LocalExecutor<'_> { | ||
| #[allow(dead_code, reason = "not all feature flags require this function")] | ||
| pub const fn new() -> Self { | ||
| Self(LocalExecutorInner::new()) | ||
| } | ||
| } | ||
|
|
||
| impl UnwindSafe for Executor<'_> {} | ||
| impl RefUnwindSafe for Executor<'_> {} | ||
|
|
||
| impl UnwindSafe for LocalExecutor<'_> {} | ||
| impl RefUnwindSafe for LocalExecutor<'_> {} | ||
|
|
||
| impl fmt::Debug for Executor<'_> { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| f.debug_struct("Executor").finish() | ||
| } | ||
| } | ||
|
|
||
| impl fmt::Debug for LocalExecutor<'_> { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| f.debug_struct("LocalExecutor").finish() | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| use crate::TaskPool; | ||
| use alloc::vec::Vec; | ||
|
|
||
| mod adapters; | ||
| pub use adapters::*; | ||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.