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

purego: use syscall.syscallX for functions with 3 or less arguments #3

Merged
merged 3 commits into from
May 25, 2022
Merged

purego: use syscall.syscallX for functions with 3 or less arguments #3

merged 3 commits into from
May 25, 2022

Conversation

TotallyGamerJet
Copy link
Collaborator

No description provided.

syscall.go Outdated
@@ -21,6 +21,11 @@ func SyscallN(fn uintptr, args ...uintptr) (r1, r2, err uintptr) {
if len(args) > maxArgs {
panic("too many arguments to SyscallN")
}
if len(args) <= 3 {
Copy link
Member

Choose a reason for hiding this comment

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

  • Could you write a comment why we needed this?
  • Do functions with 4-6 arguments work as expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe so but just in case I used the 6 version instead of the 3 version. The tests still seem to pass.

@hajimehoshi
Copy link
Member

Also I'd be happy if you could take a look at these comments:

#1 (comment)
#1 (comment)

Copy link
Member

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@hajimehoshi hajimehoshi merged commit 0f6873f into ebitengine:main May 25, 2022
TotallyGamerJet added a commit to TotallyGamerJet/purego that referenced this pull request Aug 1, 2024
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