You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support callback struct arguments on AMD64 (#42)
* fix: resolve issue #41
Add support for callback struct by-value arguments on AMD64 Unix
(System V ABI).
It's the inverse of the struct type arg support in internal/arch/amd64/call_unix.go.
Instead of marshalling from a struct to registers and the stack, data from
registers and the stack are marshalled in to a struct.
* Address a data race with writing to struct value
Writing to valPtr, for example
*(*float64)(valPtr) = getFloat()
would result in a data race
checkptr: converted pointer straddles multiple allocations
Using a []byte to represent the struct value, and then copying the
slice in to a struct reflect.Value avoids the data race.
* Add end-to-end tests for callback struct args
* Don't double increment stackIdx for partial memory chunk
It was unnecessay to call getInt for the partial chunk, as the chunk
is already in the chunk variable. And the getInt function would
increment stackIdx an extra time.
Fix the tests that test MEMORY class with a final partial chunk. The
structs used were all a multiple of 8 bytes rather than the intended
size.
* Do not write past the end of ephemeral struct storage
* Only run callback struct args tests on amd64
* Don't run callback struct arg tests Windows
* Simplify classifyEightbyte
* Use correct return type descriptor for C void functions
* Add support for nested structs in isStructAllFloats
* Add comment noting classifyEightbyte's lack of nested struct support
0 commit comments