PolarSSL v1.3.9
memory_buffer_alloc.h
Go to the documentation of this file.
1
27#ifndef POLARSSL_MEMORY_BUFFER_ALLOC_H
28#define POLARSSL_MEMORY_BUFFER_ALLOC_H
29
30#if !defined(POLARSSL_CONFIG_FILE)
31#include "config.h"
32#else
33#include POLARSSL_CONFIG_FILE
34#endif
35
36#include <stdlib.h>
37
46#if !defined(POLARSSL_MEMORY_ALIGN_MULTIPLE)
47#define POLARSSL_MEMORY_ALIGN_MULTIPLE 4
48#endif
49
50/* \} name SECTION: Module settings */
51
52#define MEMORY_VERIFY_NONE 0
53#define MEMORY_VERIFY_ALLOC (1 << 0)
54#define MEMORY_VERIFY_FREE (1 << 1)
55#define MEMORY_VERIFY_ALWAYS (MEMORY_VERIFY_ALLOC | MEMORY_VERIFY_FREE)
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
78int memory_buffer_alloc_init( unsigned char *buf, size_t len );
79
84
93void memory_buffer_set_verify( int verify );
94
95#if defined(POLARSSL_MEMORY_DEBUG)
102void memory_buffer_alloc_status( void );
103#endif /* POLARSSL_MEMORY_DEBUG */
104
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif /* memory_buffer_alloc.h */
Configuration options (set of defines)
void memory_buffer_set_verify(int verify)
Determine when the allocator should automatically verify the state of the entire chain of headers / m...
void memory_buffer_alloc_free(void)
Free the mutex for thread-safety and clear remaining memory.
int memory_buffer_alloc_verify(void)
Verifies that all headers in the memory buffer are correct and contain sane values.
int memory_buffer_alloc_init(unsigned char *buf, size_t len)
Initialize use of stack-based memory allocator.