Alex Peshkoff via Firebird-devel wrote 15.05.2018 12:13:
On 05/15/18 13:06, Dimitry Sibiryakov wrote:
15.05.2018 11:58, Alex Peshkoff via Firebird-devel wrote:
Do alignment of fields in C struct matches alignment of the same fields in
MessageBuffer?
If at compile/preprocess time construct a struct to be used directly in OO
API, will it be reliable?
Not always. For example, on 32-bit linux int64 values are aligned at 4, not
8, bytes.
Perhaps, I could handle it by adding of __attribute__((aligned(8))) to the
declaration of ISC_INT64...
Yes, it does the trick.
I see that alignment of dtype_int128 is set to sizeof(Firebird::Decimal64)
which is 8 bytes, but alignment requirement of native __int128 is 16 bytes and
cannot be decreased using alignas().
Shouldn't it to be fixed?
--
WBR, SD.
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel