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

Henri Verbeet hverbeet at gmail.com
Tue Jul 5 05:49:53 CDT 2022


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.



More information about the wine-devel mailing list