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
>
Marvin, thanks.
It seems I have to keep my manual padding!
best regards,
xjdrew
On Tuesday, May 23, 2017 at 9:27:32 PM UTC+8, Marvin Renich wrote:
>
> * Marvin Renich > [170523 08:58]:
> > Looking more closely at the MSDN docs for FwpmFilterAdd0 and
> > FWPM_FILTER0, if I were doing this, I mi
* 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 convert this value ma
* xjdrew [170523 02:31]:
> Marvin, thanks.
>
> What i'm doing is similar to your guessing.
>
> I use syscall.Syscall to call win32 api, and encounter some padding issues.
> I have resolve my problems by mannual padding days ago, but I want to know
> if there is a more graceful way to finish tha
Marvin, thanks.
What i'm doing is similar to your guessing.
I use syscall.Syscall to call win32 api, and encounter some padding issues.
I have resolve my problems by mannual padding days ago, but I want to know
if there is a more graceful way to finish that.
One of the Apis is:
DWORD WINAPI F
* xjdrew [170522 02:06]:
> 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
This smells like the XY problem. What are you actually trying to do and
how have to tried to do it (actual code, not simplified analogues)?
On Sun, 2017-05-21 at 23:05 -0700, xjdrew wrote:
> How can i use this kind of Go in windows? my machine is 64bit also.
> If I
> download the amd64 Go, the po
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 i
xjdrew,
The Go Playground is (GOOS/GOARCH) nacl/amd64p32 which is a 64 bit
architecture, where the address space is limited to a 4GB (32 bit) window.
It has 8 byte (64 bit) data structure alignment.
linux/386 and windows/386 are 32 bit architectures, where the address space
is 4GB (32 bit). Th