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

Make the raw task layout const #25

Closed
wants to merge 4 commits into from
Closed

Make the raw task layout const #25

wants to merge 4 commits into from

Conversation

james7132
Copy link

There are a few points that aren't 100% const in the std/core lib, but it's possible to compute the task layout at compile time to avoid the overhead of computing it for the task on every vtable call.

@james7132
Copy link
Author

james7132 commented Jun 17, 2022

This seems to be failing CI due to an API that was unstable when const panics was stabilized. It compiles fine locally on my 1.61 environment. I don't know if bumping the MSRV past 1.57 is a good idea: it's already pretty recent. Any opinion on this? I can just revert RawTask::from_ptr being const if need be.

@taiki-e
Copy link
Collaborator

taiki-e commented Jun 18, 2022

There are currently no plans to drop support for Rust 1.48 used by Debian stable.

@james7132
Copy link
Author

If that's the case, would writing out a const TASK_LAYOUT: Option<TaskLayout> be OK then? It'd still have the unwrap at runtime, but it'd avoid computing the layout repeatedly at runtime.

@taiki-e
Copy link
Collaborator

taiki-e commented Jun 18, 2022

Sounds good to me.

@james7132
Copy link
Author

It does seem like a lot of these const methods are available, even in 1.48. I'll close this out for now.

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

Successfully merging this pull request may close these issues.

2 participants