[Mesa-dev] [PATCH 2/3] clover: override ret_object

Francisco Jerez currojerez at riseup.net
Sun Jul 5 08:26:12 PDT 2015


EdB <edb+mesa at sigluy.net> writes:

> Return an API object from an intrusive smart reference Clover object,
> incrementing the reference count of the object.
> ---
>  src/gallium/state_trackers/clover/api/util.hpp | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/api/util.hpp b/src/gallium/state_trackers/clover/api/util.hpp
> index 918df61..6af28f2 100644
> --- a/src/gallium/state_trackers/clover/api/util.hpp
> +++ b/src/gallium/state_trackers/clover/api/util.hpp
> @@ -61,6 +61,18 @@ namespace clover {
>           *p = desc(v());
>        }
>     }
> +
> +   ///
> +   /// Return an API object from an intrusive smart reference Clover object,
> +   /// incrementing the reference count of the object.
> +   ///

The function below looks OK, but the explanation doesn't make much sense
to me.  How about "[...] from an intrusive reference to a Clover object
[...]"?

With that fixed:
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> +   template<typename T>
> +   typename T::descriptor_type *
> +   ret_object(const intrusive_ref<T> &v) {
> +      v().retain();
> +      return desc(v());
> +   }
> +
>  }
>  
>  #endif
> -- 
> 2.4.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150705/01956e07/attachment.sig>


More information about the mesa-dev mailing list