[Mesa-dev] [PATCH 12/24] i965: Initialize registers' file to BAD_FILE.

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 12 03:51:30 PST 2015


On 12 November 2015 at 00:09, Matt Turner <mattst88 at gmail.com> wrote:
> On Wed, Nov 11, 2015 at 4:08 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> Actually, your earlier statement:
>> "if file == BAD_FILE, no other fields mean anything."
>> suggests that we should change fs_reg() to simply set BAD_FILE, and
>> not bother initializing the other fields.  That would eliminate one
>> of the redundant memsets, and give us valgrind errors if we used
>> an uninitialized value.  If we do that, though, we should make
>> equals() return true for two BAD_FILE registers.
>
> That's a really good idea. I'll give that a try.
May I suggest that we do that on top (or as part of?) the series I've sent ?

On the topic of using mem{set,cmp,cpy} with C++ objects I believe that
it's highly ill-advised. A quick grep shows ~85 and 45 references
respectively in i965 and glsl. Seems like sorting these will be
another lengthy series :-]

Thanks
Emil


More information about the mesa-dev mailing list