[PATCH vkd3d 03/12] vkd3d-shader/hlsl: Introduce hlsl_free_deref().

Zebediah Figura zfigura at codeweavers.com
Tue Jul 5 12:33:32 CDT 2022


On 7/5/22 05:49, Henri Verbeet wrote:
> On Tue, 5 Jul 2022 at 12:11, Giovanni Mascellani
> <gmascellani at codeweavers.com> wrote:
>> Il 01/07/22 23:24, Francisco Casas ha scritto:
>>> +void hlsl_free_deref(struct hlsl_deref *deref)
>>> +{
>>> +    hlsl_src_remove(&deref->offset);
>>> +}
>>> +
>>
>> Again, mostly a nitpick, but personally when a function is called "free"
>> and receives a pointer, I assume that it will free the pointer itself
>> (after perhaps doing cleanup). Here there is the cleanup, but the
>> pointer is not freed, so I would rename to "hlsl_unlink_deref", for
>> example. Not sure if others agree with my sentiment.
> 
> The convention we had been using in wined3d and vkd3d for a while now
> is <object>_destroy() for functions that free the underlying storage,
> and <object>_cleanup() for functions that don't. Similarly, we have
> <object>_create() for functions that allocate storage, and
> <object>_init() for functions that don't. I'm not sure the HLSL
> compiler necessarily follows that convention though.
> 

Broadly, although in this case hlsl_deref isn't exactly an object in the 
usual sense, so I was less concerned with it.



More information about the wine-devel mailing list