FreeSWITCH API Documentation
1.7.0
|
Go to the source code of this file.
Macros | |
#define | PER_POOL_LOCK 1 |
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 PER_POOL_LOCK 1 |
Definition at line 46 of file switch_core_memory.c.
|
static |
Definition at line 504 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 614 of file switch_core_memory.c.
References memory_manager, memset(), pool_thread(), pool_thread_p, 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 596 of file switch_core_memory.c.
References memory_manager, pool_thread_p, 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 447 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().
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 414 of file switch_core_memory.c.
References memory_manager, switch_assert, SWITCH_CHANNEL_ID_LOG, 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 348 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 104 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 134 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 68 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_session_strdup | ( | switch_core_session_t * | session, |
const char * | todup, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 223 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.
char* switch_core_perform_strdup | ( | switch_memory_pool_t * | pool, |
const char * | todup, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 267 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.
switch_memory_pool_t* switch_core_session_get_pool | ( | switch_core_session_t * | session | ) |
char* switch_core_session_sprintf | ( | switch_core_session_t * | session, |
const char * | fmt, | ||
... | |||
) |
Definition at line 171 of file switch_core_memory.c.
References switch_core_vsprintf().
char* switch_core_sprintf | ( | switch_memory_pool_t * | pool, |
const char * | fmt, | ||
... | |||
) |
Definition at line 212 of file switch_core_memory.c.
References switch_core_vsprintf().
Referenced by switch_core_perform_new_memory_pool().
char* switch_core_vsprintf | ( | switch_memory_pool_t * | pool, |
const char * | fmt, | ||
va_list | ap | ||
) |
Definition at line 188 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_strdup(), and switch_core_vsprintf().
switch_memory_pool_t* memory_pool |
Definition at line 55 of file switch_core_memory.c.
switch_queue_t* pool_queue |
Definition at line 53 of file switch_core_memory.c.
switch_queue_t* pool_recycle_queue |
Definition at line 54 of file switch_core_memory.c.
|
static |
Definition at line 593 of file switch_core_memory.c.
Referenced by switch_core_memory_init(), and switch_core_memory_stop().
int pool_thread_running |
Definition at line 56 of file switch_core_memory.c.