Skip to content

Store reference to TaskLayout in TaskVTable for increased debuggability. #29

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

Conversation

michaelwoerister
Copy link
Contributor

@michaelwoerister michaelwoerister commented Jul 4, 2022

This enables debuggers to reliably decode tasks from raw memory blobs. Being able to decode raw task memory in debuggers is a prerequisite for eventually implementing logical stack traces.

@notgull
Copy link
Member

notgull commented Jul 4, 2022

I always imagined that the layout functions would compile down to a constant value after all the functions. I guess not.

I have to wonder, since the TaskLayout will never change for a given S, F and T, if it could be somehow const-evaluated at compile time and if the Header or VTable could just contain a pointer to that constant. I'm not sure if that's possible without advancing the MSRV past the previously established hard limit of 1.46, but I think it would be the best of both worlds in this case.

@michaelwoerister
Copy link
Contributor Author

Yes, I theory that should be possible and pushing the data into the TaskVTable would be ideal. But as far as I can tell, const eval support is not quite there yet (not even on nightly) -- at least I couldn't get it to work. Feel free to give it a try though. I'd be very interested in how that looks :)

@michaelwoerister
Copy link
Contributor Author

michaelwoerister commented Jul 5, 2022

Blocked on a decision about #30 (comment).

@michaelwoerister michaelwoerister force-pushed the min-logical-stack-traces-2 branch from 0b380f1 to 124ec63 Compare July 7, 2022 15:52
@michaelwoerister michaelwoerister changed the title Cache TaskLayout in Header for increased debuggability. Store reference to TaskLayout in TaskVTable for increased debuggability. Jul 7, 2022
@michaelwoerister
Copy link
Contributor Author

I've updated this now that #30 has been merged. It's much simpler now.

Copy link
Collaborator

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

Thanks!

@taiki-e taiki-e merged commit b841796 into smol-rs:master Jul 7, 2022
@taiki-e
Copy link
Collaborator

taiki-e commented Jul 7, 2022

Published this and #30 in 4.3.0.

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.

3 participants