Buffer allocator threading support
This commit is contained in:
parent
f4e7dc50ea
commit
1337affc91
5 changed files with 62 additions and 8 deletions
|
@ -71,6 +71,8 @@ int memory_set_own( void * (*malloc_func)( size_t ),
|
|||
* presented buffer and does not call malloc() and free().
|
||||
* It sets the global polarssl_malloc() and polarssl_free() pointers
|
||||
* to its own functions.
|
||||
* (Provided polarssl_malloc() and polarssl_free() are thread-safe if
|
||||
* POLARSSL_THREADING_C is defined)
|
||||
*
|
||||
* \note This code is not optimized and provides a straight-forward
|
||||
* implementation of a stack-based memory allocator.
|
||||
|
@ -82,6 +84,11 @@ int memory_set_own( void * (*malloc_func)( size_t ),
|
|||
*/
|
||||
int memory_buffer_alloc_init( unsigned char *buf, size_t len );
|
||||
|
||||
/**
|
||||
* \brief Free the mutex for thread-safety and clear remaining memory
|
||||
*/
|
||||
void memory_buffer_alloc_free();
|
||||
|
||||
/**
|
||||
* \brief Determine when the allocator should automatically verify the state
|
||||
* of the entire chain of headers / meta-data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue