24 #ifndef POLARSSL_MEMORY_BUFFER_ALLOC_H
25 #define POLARSSL_MEMORY_BUFFER_ALLOC_H
27 #if !defined(POLARSSL_CONFIG_FILE)
30 #include POLARSSL_CONFIG_FILE
43 #if !defined(POLARSSL_MEMORY_ALIGN_MULTIPLE)
44 #define POLARSSL_MEMORY_ALIGN_MULTIPLE 4
49 #define MEMORY_VERIFY_NONE 0
50 #define MEMORY_VERIFY_ALLOC (1 << 0)
51 #define MEMORY_VERIFY_FREE (1 << 1)
52 #define MEMORY_VERIFY_ALWAYS (MEMORY_VERIFY_ALLOC | MEMORY_VERIFY_FREE)
92 #if defined(POLARSSL_MEMORY_DEBUG)
99 void memory_buffer_alloc_status(
void );
107 void memory_buffer_alloc_max_get(
size_t *max_used,
size_t *max_blocks );
112 void memory_buffer_alloc_max_reset(
void );
120 void memory_buffer_alloc_cur_get(
size_t *cur_used,
size_t *cur_blocks );
136 #if defined(POLARSSL_SELF_TEST)
void memory_buffer_alloc_free(void)
Free the mutex for thread-safety and clear remaining memory.
Configuration options (set of defines)
int memory_buffer_alloc_self_test(int verbose)
Checkup routine.
void memory_buffer_set_verify(int verify)
Determine when the allocator should automatically verify the state of the entire chain of headers / m...
int memory_buffer_alloc_init(unsigned char *buf, size_t len)
Initialize use of stack-based memory allocator.
int memory_buffer_alloc_verify(void)
Verifies that all headers in the memory buffer are correct and contain sane values.