ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Reorder fields to reduce `sizeof(asio_event_t)` to 40 bytes

Open mneumann opened this issue 3 years ago • 0 comments

Reduces sizeof(struct asio_event_t) from 48 bytes to 40 bytes on 64-bit x86 Linux/FreeBSD. The noisy field was talking up 3 bytes due to aligment of the following 64-bit value nsecs at a word boundary (offset 32). The two other flags readable and writable fit in the alignment hole and no longer waste 8 bytes to align the whole struct at word boundaries again.

Note that the offset of nsecs is not changed. It still lives at offset 32.

mneumann avatar Sep 18 '22 00:09 mneumann