avcodec/refstruct: Inline ff_refstruct_allocz()

Suggested by James Almer.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/390/head
Andreas Rheinhardt 1 year ago
parent fc880c7032
commit 12c4cf9f72
  1. 5
      libavcodec/refstruct.c
  2. 6
      libavcodec/refstruct.h

@ -113,11 +113,6 @@ void *ff_refstruct_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque op
return obj;
}
void *ff_refstruct_allocz(size_t size)
{
return ff_refstruct_alloc_ext(size, 0, NULL, NULL);
}
void ff_refstruct_unref(void *objp)
{
void *obj;

@ -101,7 +101,11 @@ void *ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque,
/**
* Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
*/
void *ff_refstruct_allocz(size_t size);
static inline
void *ff_refstruct_allocz(size_t size)
{
return ff_refstruct_alloc_ext(size, 0, NULL, NULL);
}
/**
* Decrement the reference count of the underlying object and automatically

Loading…
Cancel
Save