[Mesa-dev] [PATCH 1/2] i965: Allocate vec4_visitor's uniform_size and uniform_vector_size arrays dynamically.

Francisco Jerez currojerez at riseup.net
Fri Nov 22 12:23:16 PST 2013


Kenneth Graunke <kenneth at whitecape.org> writes:

> On 11/22/2013 11:27 AM, Ian Romanick wrote:
>> On 11/22/2013 12:09 AM, Petri Latvala wrote:
>>>[...]
>>> @@ -546,6 +548,12 @@ private:
>>>      * If true, then register allocation should fail instead of spilling.
>>>      */
>>>     const bool no_spills;
>>> +
>>> +   /*
>>> +    * Make noncopyable.
>>> +    */
>>> +   vec4_visitor(const vec4_visitor&);
>>> +   vec4_visitor& operator=(const vec4_visitor&);
>[...]
> Or you could just be sensible and just not make copies of things where
> it makes no sense to do so...
>
> I would drop this hunk...it's unrelated and unnecessary.
>

It makes it less likely to make mistakes, doesn't it?  E.g. in cases
where you pass an argument by value where you really meant to pass it by
reference.  I think our code would benefit from doing this consistently,
not only because it tells the compiler which classes it makes sense to
copy and which ones don't, but also because it makes the semantics of
the class clearer to developers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131122/3936c66e/attachment.pgp>


More information about the mesa-dev mailing list