Skip to content

Conversation

qmuntal
Copy link

@qmuntal qmuntal commented Aug 19, 2020

Changes:

  • Abstract all cgo with an interface that accepts accepts and returns cgo types
  • Do all the go<->cgo heavy lifting in Wrapper but delegate the real cgo call to the interface.
  • Create one interface implementation for dynamic loading, maybe called DynamicWrapper. Put all the related c and go code in a separated files. Add an opt-out tag (act_dynload)? to this file so users that don't need it can remove it at build time.
  • Create one interface implementation for static/dynamic linking, maybe called LinkWrapper. Put all the related c and go code in a separated files. Add an opt-in tag (act_link)? to this file for users who want to support this mode.

This allows to support the two scenarios and any combination of them with a small runtime overhead.

Updates: #123

@qmuntal qmuntal changed the title Wrapp cgo calls with an interface Wrap cgo calls with an interface Jan 11, 2021
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