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

sd: Preventing panic when CGo calls in interrupt escape arguments to heap #192

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

HattoriHanzo031
Copy link
Contributor

This PR targets issue #176

Some SD Cgo calls are unnecessarily causing variables to escape to heap, and if called from an interrupt are causing panics.
Local CGo wrappers are added to prevent this.

This is a workaround until there is a proper way to prevent CGo calls escaping variables to heap (for example this Go proposal: golang#56378 )

Copy link
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

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

Thank you! This looks quite reasonable.

@aykevl aykevl merged commit d34d15d into tinygo-org:dev Sep 1, 2023
5 checks passed
aykevl added a commit that referenced this pull request Dec 24, 2023
This seems to have been broken since
#192, I suspect it's a
problem with the struct calling convention (which most certainly is a
TinyGo CGo bug, but at least this works around the problem).
@aykevl
Copy link
Member

aykevl commented Dec 24, 2023

Unfortunately this seems to have caused an issue for me, see: #209

deadprogram pushed a commit that referenced this pull request Dec 25, 2023
This seems to have been broken since
#192, I suspect it's a
problem with the struct calling convention (which most certainly is a
TinyGo CGo bug, but at least this works around the problem).
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