[go-nuts] Re: issues about struct align

2017-06-02 Thread T L
http://www.tapirgames.com/blog/golang-memory-alignment On Friday, May 19, 2017 at 7:28:54 PM UTC+8, xjdrew wrote: > > Hello everyone, > > > Code as below, playground url(https://play.golang.org/p/XSx--6uF0E): > > package main > > > import "fmt" > import "unsafe" > > > type A struct { > a uint8 >

Re: [go-nuts] Re: issues about struct align

2017-05-23 Thread Marvin Renich
* Marvin Renich [170523 08:58]: > Looking more closely at the MSDN docs for FwpmFilterAdd0 and > FWPM_FILTER0, if I were doing this, I might use «RawContext uint64» > instead of «ProviderContextKey GUID», which would be properly aligned > without manual padding. I would then

[go-nuts] Re: issues about struct align

2017-05-22 Thread xjdrew
peterGo, thanks. How can i use this kind of Go in windows? my machine is 64bit also. If I download the amd64 Go, the pointer size will be 8 bytes. My real issue is , when I call win32 api, uint64 type in the struct of win32 is aligned to 8 bytes. I have to pad the go struct by manual to make