Andreas Rheinhardt (12023-10-06):
> Do you mean a template that generates functions like
> 
> HEVCVPS *ff_hevc_vps_ref(HEVCVPS *vps)
> {
>     return ff_refstruct_ref(vps);
> }
> 
> automatically?

Yes, but better, directly:

void ff_hevc_vps_unref(HEVCVPS *vps)
{
    if (atomic_fetch_sub_explicit(&(*vps)->AVRC_FIELD, 1, memory_order_acq_rel) 
== 1) {
        AVRC_FREE(*vps);
        *vps = NULL;
    }
}

Apart from the type safety, I see a significant benefit in having the
free function hard-coded in the unref function rather than having to
spare a pointer for it.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to