RTS API Documentation  1.10.11
Functions
Memory Pool Functions
+ Collaboration diagram for Memory Pool Functions:

Functions

void switch_pool_clear (switch_memory_pool_t *pool)
 

Detailed Description

Function Documentation

◆ switch_pool_clear()

void switch_pool_clear ( switch_memory_pool_t pool)

The fundamental pool type Clear all memory in the pool and run all the cleanups. This also destroys all subpools.

Parameters
poolThe pool to clear
Remarks
This does not actually free the memory, it just allows the pool to re-use this memory for the next allocation.
See also
fspr_pool_destroy()

Definition at line 336 of file switch_core_memory.c.

References pool, SWITCH_SIZE_T_FMT, and switch_stream_handle::write_function.

337 {
338 #ifdef PER_POOL_LOCK
339  fspr_thread_mutex_t *my_mutex;
340  fspr_pool_mutex_set(p, NULL);
341 #endif
342 
343  fspr_pool_clear(p);
344 
345 #ifdef PER_POOL_LOCK
346 
347  if ((fspr_thread_mutex_create(&my_mutex, APR_THREAD_MUTEX_NESTED, p)) != APR_SUCCESS) {
348  abort();
349  }
350 
351  fspr_pool_mutex_set(p, my_mutex);
352 
353 #endif
354 
355 }