Memory Functions

March 26, 2020 Contributors
Name Description
ec_free Free memory allocated
ec_malloc Allocate a new instance of a defined object type
ec_malloc_size Allocate a block of memory of arbitrary size
ec_mem_get_stats Return usage statistics for all memtypes
ec_memory_get_total_allocated Return the total memory allocated via ec_malloc and related functions
ec_memory_is_low Called when the core detects a memory shortage
ec_memory_pretty_mem_amount A utility to render an amount with commas
ec_memory_print_allocator_details Render low-level allocator information to a string buffer
ec_memtype_by_name Returns the memtype id for a given memtype name
ec_memtype_get_stats Return usage statistics for a given memtype
ec_memtype_range_by_module Returns the range of memtypes associated with a given module
ec_memtype_register Register a new memtype with the system
ec_mt_alloc Makes an allocation against a given memtype
ec_mt_asprintf Memory-typed asprintf function
ec_mt_free Reclaim allocated memory
ec_mt_realloc Reallocate memory against a given memtype
ec_mt_register Implementation specific memtype initialization routine
ec_mt_strdup Duplicate a string of the specified memory type
ec_mt_strndup Duplicate a string of the specified message type copying at most the specified number of bytes
ec_mt_vasprintf Memory-typed vasprintf function
ec_realloc Re-allocate a block of memory, changing its size

For an overview of the Momentum memory API see Memory API. Memory usage information is available from the ec_console memory command.


For SMPP-related memory functions see SMPP Functions .