|
LMMS
|
#include "list.h"#include "rtmempool.h"#include "rtmempool-lv2.h"#include <assert.h>#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Classes | |
| struct | _RtMemPool |
Macros | |
| #define | RTMEMPOOL_THREAD_SAFETY 0 |
| #define | rtmempool_mutex_lock(...) |
| #define | rtmempool_mutex_unlock(...) |
Typedefs | |
| typedef struct list_head | k_list_head |
| typedef struct _RtMemPool | RtMemPool |
Functions | |
| static void | rtsafe_memory_pool_sleepy (RtMemPool *poolPtr, bool *overMaxOrMallocFailed) |
| static bool | rtsafe_memory_pool_create2 (RtMemPool_Handle *handlePtr, const char *poolName, size_t dataSize, size_t minPreallocated, size_t maxPreallocated) |
| static unsigned char | rtsafe_memory_pool_create_old (const char *poolName, size_t dataSize, size_t minPreallocated, size_t maxPreallocated, RtMemPool_Handle *handlePtr) |
| bool | rtsafe_memory_pool_create (RtMemPool_Handle *handlePtr, const char *poolName, size_t dataSize, size_t minPreallocated, size_t maxPreallocated) |
| void | rtsafe_memory_pool_destroy (RtMemPool_Handle handle) |
| void * | rtsafe_memory_pool_allocate_atomic (RtMemPool_Handle handle) |
| void * | rtsafe_memory_pool_allocate_sleepy (RtMemPool_Handle handle) |
| void | rtsafe_memory_pool_deallocate (RtMemPool_Handle handle, void *memoryPtr) |
| void | lv2_rtmempool_init (LV2_RtMemPool_Pool *poolPtr) |
| void | lv2_rtmempool_init_deprecated (LV2_RtMemPool_Pool_Deprecated *poolPtr) |
| #define rtmempool_mutex_lock | ( | ... | ) |
| #define rtmempool_mutex_unlock | ( | ... | ) |
| #define RTMEMPOOL_THREAD_SAFETY 0 |
| typedef struct list_head k_list_head |
| typedef struct _RtMemPool RtMemPool |
| void lv2_rtmempool_init | ( | LV2_RtMemPool_Pool * | poolPtr | ) |
Initialize LV2_RTSAFE_MEMORY_POOL__Pool feature
| poolPtr | host allocated pointer to LV2_RtMemPool_Pool |
| void lv2_rtmempool_init_deprecated | ( | LV2_RtMemPool_Pool_Deprecated * | poolPtr | ) |
| void * rtsafe_memory_pool_allocate_atomic | ( | RtMemPool_Handle | handle | ) |
Allocate memory in context where sleeping is not allowed
will not sleep
| void * rtsafe_memory_pool_allocate_sleepy | ( | RtMemPool_Handle | handle | ) |
Allocate memory in context where sleeping is allowed
may/will sleep
| bool rtsafe_memory_pool_create | ( | RtMemPool_Handle * | handlePtr, |
| const char * | poolName, | ||
| size_t | dataSize, | ||
| size_t | minPreallocated, | ||
| size_t | maxPreallocated ) |
Create new memory pool
may/will sleep
| poolName | pool name, for debug purposes, max RTSAFE_MEMORY_POOL_NAME_MAX chars, including terminating zero char. May be NULL. |
| dataSize | memory chunk size |
| minPreallocated | min chunks preallocated |
| maxPreallocated | max chunks preallocated |
|
static |
|
static |
| void rtsafe_memory_pool_deallocate | ( | RtMemPool_Handle | handle, |
| void * | memoryPtr ) |
Deallocate previously allocated memory
will not sleep
| memoryPtr | pointer to previously allocated memory chunk |
| void rtsafe_memory_pool_destroy | ( | RtMemPool_Handle | handle | ) |
Destroy previously created memory pool
may/will sleep