|
RTS API Documentation
1.10.11
|
Include dependency graph for switch_core_memory.c:Go to the source code of this file.
Macros | |
| #define | PER_POOL_LOCK 1 |
| #define | DEBUG_ALLOC_CUTOFF 500 |
Variables | |
| struct { | |
| switch_queue_t * pool_queue | |
| switch_queue_t * pool_recycle_queue | |
| switch_memory_pool_t * memory_pool | |
| int pool_thread_running | |
| } | memory_manager |
| static switch_thread_t * | pool_thread_p = NULL |
| #define DEBUG_ALLOC_CUTOFF 500 |
Definition at line 51 of file switch_core_memory.c.
Referenced by switch_core_perform_alloc(), switch_core_perform_session_alloc(), switch_core_perform_session_strdup(), and switch_core_perform_strndup().
| #define PER_POOL_LOCK 1 |
Definition at line 48 of file switch_core_memory.c.
|
static |
Definition at line 579 of file switch_core_memory.c.
References memory_manager, SWITCH_CHANNEL_LOG, switch_core_memory_reclaim(), SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_pop(), switch_queue_size(), switch_queue_trypop(), switch_queue_trypush(), SWITCH_STATUS_SUCCESS, and switch_yield.
Referenced by switch_core_memory_init().
| switch_memory_pool_t* switch_core_memory_init | ( | void | ) |
Definition at line 689 of file switch_core_memory.c.
References memory_manager, memset(), pool_thread(), switch_assert, switch_cond_next(), switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_queue_create(), switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), and switch_threadattr_stacksize_set().
Referenced by switch_core_init().
| void switch_core_memory_stop | ( | void | ) |
Definition at line 671 of file switch_core_memory.c.
References memory_manager, SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_queue_trypop(), SWITCH_STATUS_SUCCESS, and switch_thread_join().
Referenced by switch_core_destroy().
| void* switch_core_perform_alloc | ( | switch_memory_pool_t * | pool, |
| switch_size_t | memory, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 518 of file switch_core_memory.c.
References DEBUG_ALLOC_CUTOFF, memory_manager, memset(), switch_assert, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), and switch_mutex_unlock().
| switch_status_t switch_core_perform_destroy_memory_pool | ( | switch_memory_pool_t ** | pool, |
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 465 of file switch_core_memory.c.
References memory_manager, pool, switch_assert, SWITCH_CHANNEL_ID_LOG, switch_core_sprintf(), SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_push(), and SWITCH_STATUS_SUCCESS.
| switch_status_t switch_core_perform_new_memory_pool | ( | switch_memory_pool_t ** | pool, |
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 391 of file switch_core_memory.c.
References memory_manager, switch_assert, SWITCH_CHANNEL_ID_LOG, switch_core_sprintf(), SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypop(), and SWITCH_STATUS_SUCCESS.
| void* switch_core_perform_permanent_alloc | ( | switch_size_t | memory, |
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 113 of file switch_core_memory.c.
References memory_manager, memset(), switch_assert, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), and switch_mutex_unlock().
| char* switch_core_perform_permanent_strdup | ( | const char * | todup, |
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 143 of file switch_core_memory.c.
References memory_manager, switch_assert, SWITCH_BLANK_STRING, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and zstr.
| void* switch_core_perform_session_alloc | ( | switch_core_session_t * | session, |
| switch_size_t | memory, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 73 of file switch_core_memory.c.
References DEBUG_ALLOC_CUTOFF, memory_manager, memset(), switch_core_session::pool, switch_assert, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), and switch_mutex_unlock().
| char* switch_core_perform_session_strdup | ( | switch_core_session_t * | session, |
| const char * | todup, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 232 of file switch_core_memory.c.
References DEBUG_ALLOC_CUTOFF, memory_manager, switch_core_session::pool, switch_assert, SWITCH_BLANK_STRING, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and zstr.
| char* switch_core_perform_strdup | ( | switch_memory_pool_t * | pool, |
| const char * | todup, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 276 of file switch_core_memory.c.
References switch_core_perform_strndup().
| char* switch_core_perform_strndup | ( | switch_memory_pool_t * | pool, |
| const char * | todup, | ||
| size_t | len, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
Definition at line 281 of file switch_core_memory.c.
References DEBUG_ALLOC_CUTOFF, memory_manager, switch_assert, SWITCH_BLANK_STRING, SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and zstr.
Referenced by switch_core_perform_strdup().
| switch_memory_pool_t* switch_core_session_get_pool | ( | switch_core_session_t * | session | ) |
Definition at line 64 of file switch_core_memory.c.
References switch_core_session::pool, and switch_assert.
| char* switch_core_session_sprintf | ( | switch_core_session_t * | session, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 180 of file switch_core_memory.c.
References switch_core_session::pool, and switch_core_vsprintf().
| char* switch_core_sprintf | ( | switch_memory_pool_t * | pool, |
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 221 of file switch_core_memory.c.
References switch_core_vsprintf().
Referenced by switch_core_perform_destroy_memory_pool(), and switch_core_perform_new_memory_pool().
| char* switch_core_vsprintf | ( | switch_memory_pool_t * | pool, |
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Definition at line 197 of file switch_core_memory.c.
References memory_manager, switch_assert, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_session_sprintf(), switch_core_session_vsprintf(), and switch_core_sprintf().
| struct { ... } memory_manager |
Referenced by pool_thread(), switch_core_memory_init(), switch_core_memory_reclaim(), switch_core_memory_stop(), switch_core_perform_alloc(), switch_core_perform_destroy_memory_pool(), switch_core_perform_new_memory_pool(), switch_core_perform_permanent_alloc(), switch_core_perform_permanent_strdup(), switch_core_perform_session_alloc(), switch_core_perform_session_strdup(), switch_core_perform_strndup(), and switch_core_vsprintf().
| switch_memory_pool_t* memory_pool |
Definition at line 60 of file switch_core_memory.c.
| switch_queue_t* pool_queue |
Definition at line 58 of file switch_core_memory.c.
| switch_queue_t* pool_recycle_queue |
Definition at line 59 of file switch_core_memory.c.
|
static |
Definition at line 668 of file switch_core_memory.c.
| int pool_thread_running |
Definition at line 61 of file switch_core_memory.c.
1.8.13