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

bugfix: fix rkyv alignment #1780

Draft
wants to merge 4 commits into
base: bing/rkyv-access
Choose a base branch
from

Conversation

codeblooded1729
Copy link
Contributor

No description provided.

@@ -60,7 +61,9 @@ pub struct TokenObject {

impl From<StateObject> for TokenObject {
fn from(value: StateObject) -> Self {
let archived = rkyv::access::<TokenObject, Failure>(&value.data[..]).unwrap();
let mut aligned_data = AlignedVec::with_capacity(value.data.len());
aligned_data.extend_from_slice(&value.data);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems suspicious. I suspect we want our StateObject's data to be an AlignedVec in the first place, then we don't need to copy here. (Assuming this code also gets executed on guest.)

Copy link
Collaborator

@matthiasgoergens matthiasgoergens left a comment

Choose a reason for hiding this comment

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

What's the status of this PR?

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.

2 participants