Closed karutten closed 8 months ago
When i open a device, i get this error: allocaBytesAligned: invalid argument (alignment (=20) must be a power of two!) Using GHC 9.2.5 on Windows.
allocaBytesAligned: invalid argument (alignment (=20) must be a power of two!)
I was able to fix this by changing the alignment of two Storable instances, that are currently invalid: https://github.com/standardsemiconductor/serialport/blob/bbebf5f0c3c7b0ee0cd89279ec3170b4d47d59ac/System/Win32/Comm.hsc#L40 https://github.com/standardsemiconductor/serialport/blob/bbebf5f0c3c7b0ee0cd89279ec3170b4d47d59ac/System/Win32/Comm.hsc#L141
I used 16 to be sure, but 8 or even 4 is probably enough. A proper solution would probably be to reuse the alignment of one of the fields.
Thanks for bringing this to my attention! When I can find free time I will address this. Feel free to open a PR as well.
When i open a device, i get this error:
allocaBytesAligned: invalid argument (alignment (=20) must be a power of two!)
Using GHC 9.2.5 on Windows.I was able to fix this by changing the alignment of two Storable instances, that are currently invalid: https://github.com/standardsemiconductor/serialport/blob/bbebf5f0c3c7b0ee0cd89279ec3170b4d47d59ac/System/Win32/Comm.hsc#L40 https://github.com/standardsemiconductor/serialport/blob/bbebf5f0c3c7b0ee0cd89279ec3170b4d47d59ac/System/Win32/Comm.hsc#L141
I used 16 to be sure, but 8 or even 4 is probably enough. A proper solution would probably be to reuse the alignment of one of the fields.