Pool (memory) class.
More...
◆ mlt_pool_alloc()
void * mlt_pool_alloc |
( |
int |
size | ) |
|
Allocate size bytes from the pool.
- Parameters
-
◆ mlt_pool_close()
◆ mlt_pool_init()
Initialise the global pool.
◆ mlt_pool_purge()
Purge unused items in the pool.
A form of garbage collection.
◆ mlt_pool_realloc()
void * mlt_pool_realloc |
( |
void * |
ptr, |
|
|
int |
size |
|
) |
| |
Allocate size bytes from the pool.
- Parameters
-
ptr | an opaque pointer - can be in the pool or a new block to allocate |
size | the number of bytes |
◆ mlt_pool_release()
void mlt_pool_release |
( |
void * |
release | ) |
|
Release the allocated memory.
- Parameters
-
release | an opaque pointer of a block in the pool |
◆ pool_close()
Destroy a pool.
- Parameters
-
◆ pool_fetch()
static void * pool_fetch |
( |
mlt_pool |
self | ) |
|
|
private |
Get an item from the pool.
- Parameters
-
- Returns
- an opaque pointer
◆ pool_init()
Create a pool.
- Parameters
-
size | the size of the memory blocks to hold as some power of two |
- Returns
- a new pool object
◆ pool_return()
static void pool_return |
( |
void * |
ptr | ) |
|
|
private |
Return an item to the pool.
- Parameters
-
◆ count
the number of blocks in the pool
◆ lock
pthread_mutex_t mlt_pool_s::lock |
lock to prevent race conditions
◆ size
the size of the memory block as a power of 2
◆ stack
a stack of addresses to memory blocks
The documentation for this struct was generated from the following file: