Nicolas George:
> 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.
> 

And as I have already explained, I do not think that this benefit is
significant and you have provided no evidence (i.e. an example) that it
is so. Additionally, the flexibility provided by function pointers is
useful for stuff like CBS.

- Andreas

_______________________________________________
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