diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-05 18:32:23 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-11-01 20:07:23 +0100 |
commit | 26c0a7321fdef730050156fcef0b986ac4373b6c (patch) | |
tree | 2b242b645118190b41ba89cf285511aa016bb024 /libavformat/fitsdec.c | |
parent | 92bcc6703acf346f0a5257de2410400a2e81a754 (diff) | |
download | ffmpeg-26c0a7321fdef730050156fcef0b986ac4373b6c.tar.gz |
avcodec/refstruct: Add RefStruct pool API
Very similar to the AVBufferPool API, but with some differences:
1. Reusing an already existing entry does not incur an allocation
at all any more (the AVBufferPool API needs to allocate an AVBufferRef).
2. The tasks done while holding the lock are smaller; e.g.
allocating new entries is now performed without holding the lock.
The same goes for freeing.
3. The entries are freed as soon as possible (the AVBufferPool API
frees them in two batches: The first in av_buffer_pool_uninit() and
the second immediately before the pool is freed when the last
outstanding entry is returned to the pool).
4. The API is designed for objects and not naked buffers and
therefore has a reset callback. This is called whenever an object
is returned to the pool.
5. Just like with the RefStruct API, custom allocators are not
supported.
(If desired, the FFRefStructPool struct itself could be made
reference counted via the RefStruct API; an FFRefStructPool
would then be freed via ff_refstruct_unref().)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/fitsdec.c')
0 files changed, 0 insertions, 0 deletions