[PATCH v3 4/6] shell32/autocomplete: Re-arrange some fields for better packing

Alexandre Julliard julliard at winehq.org
Thu Sep 27 06:18:32 CDT 2018


Gabriel Ivăncescu <gabrielopcode at gmail.com> writes:

> On Thu, Sep 27, 2018 at 1:55 PM, Alexandre Julliard <julliard at winehq.org> wrote:
>>
>> Why is packing relevant at all? How many of these structures are you
>> expecting to allocate?
>>
>> --
>> Alexandre Julliard
>> julliard at winehq.org
>
> It's not that it's really relevant (patch was really minor), but the
> original used two BOOLs and then I had to add a UCHAR (next patch,
> this was split from), each of which would have 3 bytes of padding (and
> more on x86_64 later, when I'll have to add more fields), which just
> seems a bit wasteful for the cache and a bit inelegant to me. I mean
> it's a trivial change anyway, it's not like it makes the code itself
> worse off, IMO. :-)

It's a gratuitous change, and in many cases would generate worse code
because of the need to manipulate bits. Losing a couple of padding bytes
here and there is not a problem that needs fixing.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list