Skip to content

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

Merged
taiki-e merged 1 commit into
smol-rs:masterfrom
michaelwoerister:min-logical-stack-traces-2
Jul 7, 2022
Merged

taiki-e merged 1 commit into
smol-rs:masterfrom
michaelwoerister:min-logical-stack-traces-2

Conversation

@michaelwoerister

@michaelwoerister michaelwoerister commented Jul 4, 2022 •

Copy link
Copy Markdown
Contributor

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

notgull commented Jul 4, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

michaelwoerister commented Jul 5, 2022 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

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

@taiki-e taiki-e left a comment

Copy link
Copy Markdown
Collaborator

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

taiki-e commented Jul 7, 2022

Copy link
Copy Markdown
Collaborator

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