Go to the documentation of this file.
19 #ifndef AVCODEC_REFSTRUCT_H
20 #define AVCODEC_REFSTRUCT_H
67 #define FF_REFSTRUCT_FLAG_NO_ZEROING (1 << 0)
static void * ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
A wrapper around ff_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
RefStruct is an API for creating reference-counted objects with minimal overhead.
int ff_refstruct_exclusive(const void *obj)
Check whether the reference count of an object managed via this API is 1.
static void * ff_refstruct_allocz(size_t size)
Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
const void * ff_refstruct_ref_c(const void *obj)
Analog of ff_refstruct_ref(), but for constant objects.
void * ff_refstruct_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
Allocate a refcounted object of usable size size managed via the RefStruct API.
void * ff_refstruct_ref(void *obj)
Create a new reference to an object managed via this API, i.e.
void ff_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
#define flags(name, subs,...)
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...