Re: [webkit-dev] PSA: Bit fields won't be packed on Windows if you mix types

2020-09-04 Thread Darin Adler
> On Sep 3, 2020, at 11:14 PM, Fujii Hironori  wrote:
> 
> BTW, I don't like to idea adding a new rule, but keeping old style code. It 
> introduces divergence between the guideline and actual code. Do we really 
> need a new rule that one doesn’t necessary have to follow?

I understand that you don’t like this.

But all of our style rules are like this. We don’t apply them across our entire 
project at the moment we institute them. They guide the future of WebKit. So 
this is not a valid argument against adding a new rule.

You can help us apply a given rule to existing code if you feel strongly in a 
particular case, and in some cases it might be practical to quickly apply it 
everywhere relevant. Maybe in this case it is.

But that’s not the basis for deciding whether to make it a rule.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] PSA: Bit fields won't be packed on Windows if you mix types

2020-09-04 Thread Ryosuke Niwa
On Thu, Sep 3, 2020 at 11:15 PM Fujii Hironori 
wrote:

>
> On Fri, Sep 4, 2020 at 2:56 PM Ryosuke Niwa  wrote:
>
>> On Thu, Sep 3, 2020 at 10:11 PM Fujii Hironori 
>> wrote:
>>
>>>
>>> On Fri, Sep 4, 2020 at 1:31 PM Ryosuke Niwa  wrote:
>>>
 Consecutive bit fields must use the same type.

>>>
>>> RenderLayer is mixing bool and unsigned in the consecutive bit fields.
>>> They should use only uint8_t, right?
>>>
>>> https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/rendering/RenderLayer.h#L1263
>>>
>>
>> Under the proposed coding style guide, yes, although I highly doubt the
>> size of RenderLayer really matters.
>>
>>
> Do you mean your new rule is applicable only for performance
> critical parts?
>

No, I'm saying that applying the proposed guideline wouldn't necessarily
help memory usage cause RenderLayer is a really large object anyway.
It doesn't mean we shouldn't apply.

BTW, I don't like to idea adding a new rule, but keeping old
> style code. It introduces divergence between the guideline and
> actual code. Do we really need a new rule that one doesn't
> necessary have to follow?
>

We should follow the proposed guideline in new code but we typically don't
update existing code to match the new guideline when we introduce a new
coding style guideline.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev