My Project
Functions
memory.h File Reference

Go to the source code of this file.

Functions

void * wolfSSL_Malloc (size_t size, void *heap, int type)
 This function is similar to malloc(), but calls the memory allocation function which wolfSSL has been configured to use. By default, wolfSSL uses malloc(). This can be changed using the wolfSSL memory abstraction layer - see wolfSSL_SetAllocators(). Note wolfSSL_Malloc is not called directly by wolfSSL, but instead called by macro XMALLOC. For the default build only the size argument exists. If using WOLFSSL_STATIC_MEMORY build then heap and type arguments are included. More...
 
void wolfSSL_Free (void *ptr, void *heap, int type)
 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(). Note wolfSSL_Free is not called directly by wolfSSL, but instead called by macro XFREE. For the default build only the ptr argument exists. If using WOLFSSL_STATIC_MEMORY build then heap and type arguments are included. More...
 
void * wolfSSL_Realloc (void *ptr, size_t size, void *heap, int type)
 This function is similar to realloc(), but calls the memory re-allocation function which wolfSSL has been configured to use. By default, wolfSSL uses realloc(). This can be changed using the wolfSSL memory abstraction layer - see wolfSSL_SetAllocators(). Note wolfSSL_Realloc is not called directly by wolfSSL, but instead called by macro XREALLOC. For the default build only the size argument exists. If using WOLFSSL_STATIC_MEMORY build then heap and type arguments are included. More...
 
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. More...
 
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. More...
 
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. More...
 
int wolfSSL_CTX_load_static_memory (WOLFSSL_CTX **ctx, wolfSSL_method_func method, unsigned char *buf, unsigned int sz, int flag, int max)
 This function is used to set aside static memory for a CTX. Memory set aside is then used for the CTX’s lifetime and for any SSL objects created from the CTX. By passing in a NULL ctx pointer and a wolfSSL_method_func function the creation of the CTX itself will also use static memory. wolfSSL_method_func has the function signature of WOLFSSL_METHOD* (wolfSSL_method_func)(void heap);. Passing in 0 for max makes it behave as if not set and no max concurrent use restrictions is in place. The flag value passed in determines how the memory is used and behavior while operating. Available flags are the following. More...
 
int wolfSSL_CTX_is_static_memory (WOLFSSL_CTX *ctx, WOLFSSL_MEM_STATS *mem_stats)
 This function does not change any of the connections behavior and is used only for gathering information about the static memory usage. More...
 
int wolfSSL_is_static_memory (WOLFSSL *ssl, WOLFSSL_MEM_CONN_STATS *mem_stats)
 wolfSSL_is_static_memory is used to gather information about a SSL’s static memory usage. The return value indicates if static memory is being used and WOLFSSL_MEM_CONN_STATS will be filled out if and only if the flag WOLFMEM_TRACK_STATS was passed to the parent CTX when loading in static memory. More...
 
int wc_LoadStaticMemory (WOLFSSL_HEAP_HINT *hint, unsigned char *buf, unsigned int sz, int flag, int max)
 This function is used to set aside static memory for wolfCrypt use. Memory can be used by passing the created heap hint into functions. An example of this is when calling wc_InitRng_ex. The flag value passed in determines how the memory is used and behavior while operating, in general wolfCrypt operations will use memory from a WOLFMEM_GENERAL pool. Available flags are the following. More...