Hi all!
On 2020-07-01 17:05 +0200, Anton Khirnov wrote:
> Quoting Nicolas George (2020-06-27 17:16:44)
> > Signed-off-by: Nicolas George
> > ---
> > libavutil/avrefcount_template.h | 140
> > tests/ref/fate/source | 1 +
> > 2 files changed, 141 inser
Quoting James Almer (2020-07-01 20:20:32)
> On 7/1/2020 12:05 PM, Anton Khirnov wrote:
> > Quoting Nicolas George (2020-06-27 17:16:44)
> >> Signed-off-by: Nicolas George
> >> ---
> >> libavutil/avrefcount_template.h | 140
> >> tests/ref/fate/source |
Jul 1, 2020, 19:20 by jamr...@gmail.com:
> On 7/1/2020 12:05 PM, Anton Khirnov wrote:
>
>> Quoting Nicolas George (2020-06-27 17:16:44)
>>
>>> Signed-off-by: Nicolas George
>>> ---
>>> libavutil/avrefcount_template.h | 140
>>> tests/ref/fate/source |
Anton Khirnov (12020-07-01):
> You do not dereference buf->opaque. You pass it to the free callback
> when the refcount reaches zero, that is the only way it should ever be
> used.
You are talking about the implementation of the refcounted structure. I
was talking about when we use the refcounted
James Almer (12020-07-01):
> I very much prefer this approach, being clean looking, public, and free
> of macros from unguarded headers
Please do not forget the major drawback:
This version makes the creation of the refcounted structure simpler, and
every single use more complex.
One creation, m
Quoting Nicolas George (2020-07-01 18:47:15)
> Anton Khirnov (12020-07-01):
> > instead of
> > #define AVRC_TYPE AVBuffer
> > #define AVRC_PREFIX prefix
> > #define AVRC_FIELD refcount
> > you'd have
> > av_refcount_init(&buf->refcount, buf, buffer_free);
> > Does not look more annoying to me, to t
On 7/1/2020 12:05 PM, Anton Khirnov wrote:
> Quoting Nicolas George (2020-06-27 17:16:44)
>> Signed-off-by: Nicolas George
>> ---
>> libavutil/avrefcount_template.h | 140
>> tests/ref/fate/source | 1 +
>> 2 files changed, 141 insertions(+)
>> create
Anton Khirnov (12020-07-01):
> instead of
> #define AVRC_TYPE AVBuffer
> #define AVRC_PREFIX prefix
> #define AVRC_FIELD refcount
> you'd have
> av_refcount_init(&buf->refcount, buf, buffer_free);
> Does not look more annoying to me, to the contrary macro templates
> require more effort to understa
Quoting Nicolas George (2020-07-01 17:13:22)
> Anton Khirnov (12020-07-01):
> > Why a template? It seems simpler to add a struct like
> > typedef struct AVRefcount {
> > atomic_uint refcount;
> > void *opaque;
> > void (*free)(void *opaque);
> > } AVRefcount;
> > and then emb
Anton Khirnov (12020-07-01):
> Why a template? It seems simpler to add a struct like
> typedef struct AVRefcount {
> atomic_uint refcount;
> void *opaque;
> void (*free)(void *opaque);
> } AVRefcount;
> and then embed it in everything that wants to be refcounted. All just
> n
Quoting Nicolas George (2020-06-27 17:16:44)
> Signed-off-by: Nicolas George
> ---
> libavutil/avrefcount_template.h | 140
> tests/ref/fate/source | 1 +
> 2 files changed, 141 insertions(+)
> create mode 100644 libavutil/avrefcount_template.h
>
>
11 matches
Mail list logo