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

Avoid copy between EmitResult and SmooshResult in m-c #559

Open
arai-a opened this issue Jun 10, 2020 · 0 comments
Open

Avoid copy between EmitResult and SmooshResult in m-c #559

arai-a opened this issue Jun 10, 2020 · 0 comments

Comments

@arai-a
Copy link
Collaborator

arai-a commented Jun 10, 2020

smoosh crate in m-c is currently copying jsparagus's EmitResult into SmooshResult, for the following reasons:

  • binding needs #[repr(C)], and EmitResult doesn't have it
  • we copy Vec<T> into CVec<T>
    • This can be solved if:
      • Vec<T> can be exposed to C, or
      • We add accessor functions that takes the reference
  • To handle ownership and free it later
  • (not yet in master) Option<T> needs some conversion, or type definition
  • enum variant needs some conversion, or accessor
    • cbindgen can generate accessor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant