diff options
author | Henrik Gramner <gramner@twoorioles.com> | 2020-11-20 03:37:54 +0300 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2020-11-22 16:51:03 +0300 |
commit | 236e1122da50c23d95766682590d546f787684ea (patch) | |
tree | baf702b6c70baefc15a07ebb051c9deeaf843f17 /src/ref.h | |
parent | dc98fff8757e018a4a74217aade64a10b7afd46d (diff) |
Add more buffer pools
Add buffer pools for miscellaneous smaller buffers that are
repeatedly being freed and reallocated.
Also improve dav1d_ref_create() by consolidating two separate
memory allocations into a single one.
Diffstat (limited to 'src/ref.h')
-rw-r--r-- | src/ref.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -30,6 +30,9 @@ #include "dav1d/dav1d.h" +#include "src/mem.h" +#include "src/thread.h" + #include <stdatomic.h> #include <stddef.h> @@ -37,11 +40,13 @@ struct Dav1dRef { void *data; const void *const_data; atomic_int ref_cnt; + int free_ref; void (*free_callback)(const uint8_t *data, void *user_data); void *user_data; }; Dav1dRef *dav1d_ref_create(size_t size); +Dav1dRef *dav1d_ref_create_using_pool(Dav1dMemPool *pool, size_t size); Dav1dRef *dav1d_ref_wrap(const uint8_t *ptr, void (*free_callback)(const uint8_t *data, void *user_data), void *user_data); |