My Project
Loading...
Searching...
No Matches
memory.h File Reference

Go to the source code of this file.

Data Structures

struct  WOLFSSL_MEM_CONN_STATS
 
struct  WOLFSSL_MEM_STATS
 
struct  WOLFSSL_HEAP
 
struct  WOLFSSL_HEAP_HINT
 

Typedefs

typedef void *(* wolfSSL_Malloc_cb) (size_t size, void *heap, int type, const char *func, unsigned int line)
 
typedef void(* wolfSSL_Free_cb) (void *ptr, void *heap, int type, const char *func, unsigned int line)
 
typedef void *(* wolfSSL_Realloc_cb) (void *ptr, size_t size, void *heap, int type, const char *func, unsigned int line)
 
typedef struct wc_Memory wc_Memory
 
typedef struct WOLFSSL_HEAP WOLFSSL_HEAP
 
typedef struct WOLFSSL_HEAP_HINT WOLFSSL_HEAP_HINT
 

Functions

WOLFSSL_API void * wolfSSL_Malloc (size_t size, void *heap, int type, const char *func, unsigned int line)
 This function calls the custom malloc function, if one has been defined, or simply calls the default C malloc function if no custom function exists. It is not called directly by wolfSSL, but instead generally called by using XMALLOC, which may be replaced by wolfSSL_Malloc during preprocessing.
 
WOLFSSL_API void wolfSSL_Free (void *ptr, void *heap, int type, const char *func, unsigned int line)
 This function calls a custom free function, if one has been defined, or simply calls the default C free function if no custom function exists. It is not called directly by wolfSSL, but instead generally called by using XFREE, which may be replaced by wolfSSL_Free during preprocessing.
 
WOLFSSL_API void * wolfSSL_Realloc (void *ptr, size_t size, void *heap, int type, const char *func, unsigned int line)
 This function calls a custom realloc function, if one has been defined, or simply calls the default C realloc function if no custom function exists. It is not called directly by wolfSSL, but instead generally called by using XREALLOC, which may be replaced by wolfSSL_Realloc during preprocessing.
 
WOLFSSL_API void * wolfSSL_Malloc (size_t size, void *heap, int type)
 
WOLFSSL_API void wolfSSL_Free (void *ptr, void *heap, int type)
 
WOLFSSL_API void * wolfSSL_Realloc (void *ptr, size_t size, void *heap, int type)
 
WOLFSSL_API void * wolfSSL_Malloc (size_t size, const char *func, unsigned int line)
 
WOLFSSL_API void wolfSSL_Free (void *ptr, const char *func, unsigned int line)
 This function is similar to free(), but calls the memory free function which wolfSSL has been configured to use. By default, wolfSSL uses free(). This can be changed using the wolfSSL memory abstraction layer - see wolfSSL_SetAllocators().
 
WOLFSSL_API void * wolfSSL_Realloc (void *ptr, size_t size, const char *func, unsigned int line)
 
WOLFSSL_API void * wolfSSL_Malloc (size_t size)
 
WOLFSSL_API void wolfSSL_Free (void *ptr)
 
WOLFSSL_API void * wolfSSL_Realloc (void *ptr, size_t size)
 
WOLFSSL_API int wolfSSL_SetAllocators (wolfSSL_Malloc_cb, wolfSSL_Free_cb, wolfSSL_Realloc_cb)
 This function registers the allocation functions used by wolfSSL. By default, if the system supports it, malloc/free and realloc are used. Using this function allows the user at runtime to install their own memory handlers.
 
WOLFSSL_API int wolfSSL_GetAllocators (wolfSSL_Malloc_cb *, wolfSSL_Free_cb *, wolfSSL_Realloc_cb *)
 
WOLFSSL_API int wc_LoadStaticMemory (WOLFSSL_HEAP_HINT **pHint, unsigned char *buf, unsigned int sz, int flag, int max)
 
WOLFSSL_LOCAL int wolfSSL_init_memory_heap (WOLFSSL_HEAP *heap)
 
WOLFSSL_LOCAL int wolfSSL_load_static_memory (byte *buffer, word32 sz, int flag, WOLFSSL_HEAP *heap)
 
WOLFSSL_LOCAL int wolfSSL_GetMemStats (WOLFSSL_HEAP *heap, WOLFSSL_MEM_STATS *stats)
 
WOLFSSL_LOCAL int SetFixedIO (WOLFSSL_HEAP *heap, wc_Memory **io)
 
WOLFSSL_LOCAL int FreeFixedIO (WOLFSSL_HEAP *heap, wc_Memory **io)
 
WOLFSSL_API int wolfSSL_StaticBufferSz (byte *buffer, word32 sz, int flag)
 This function is available when static memory feature is used (–enable-staticmemory). It gives the optimum buffer size for memory “buckets”. This allows for a way to compute buffer size so that no extra unused memory is left at the end after it has been partitioned. The returned value, if positive, is the computed buffer size to use.
 
WOLFSSL_API int wolfSSL_MemoryPaddingSz (void)
 This function is available when static memory feature is used (–enable-staticmemory). It gives the size of padding needed for each partition of memory. This padding size will be the size needed to contain a memory management structure along with any extra for memory alignment.
 
WOLFSSL_API void __attribute__ ((no_instrument_function)) __cyg_profile_func_enter(void *func
 

Variables

 C
 
WOLFSSL_API void void * caller
 

Variable Documentation

◆ C

C
extern
Initial value:
{
#endif
#ifdef WOLFSSL_FORCE_MALLOC_FAIL_TEST
WOLFSSL_API void wolfSSL_SetMemFailCount(int memFailCount)