Skip to content

poc for 2024 wasm #33

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

poc for 2024 wasm #33

wants to merge 1 commit into from

Conversation

Saschl
Copy link
Contributor

@Saschl Saschl commented Mar 26, 2025

Just for information, it's not complete and breaks 2020 compatibility

sys::fsVarsAircraftVarGet(self.simvar, self.units, params_for_get, &mut v);

// drop the mem
drop(Box::from_raw(params_for_get.array));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the drop is not needed here. I experimented a lot as I initially thought some of the issues I encountered were caused by memory issues, but that was not the case.


array.push(sys::FsVarParamVariant {
type_: sys::eFsVarParamType_FsVarParamTypeInteger,
__bindgen_anon_1: sys::FsVarParamVariant__bindgen_ty_1 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugly, but that's what bindgen gives us here. Guess it happens because there's no anonymous unions in rust

});

let params_for_set = sys::FsVarParamArray {
size: 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can hold more than one obviously :D Was enough for our use case, but should be handled properly

};

self.executor.send(Some(data)).unwrap();
/* sys::PANEL_SERVICE_POST_KILL => self.executor.send(None).is_ok(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be removed for 2024 systems as the callbacks are separated now.

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.

1 participant