Skip to main content

Name

ec_free — Free memory allocated

Synopsis

#include "ec_malloc.h"

| void **ec_free** ( | object_type, |   | |   | ptr); |   |

int <var class="pdparam">object_type</var>; void * <var class="pdparam">ptr</var>;

Description

Returns memory allocated by ec_malloc, ec_malloc_size or ec_realloc to the allocator layer, ready for reuse.

Other functions which allocate memory and must use ec_free are and ec_mt_strdup ec_mt_strndup. Note: ec_strdup and ec_strndup are macros that invoke the preceding functions so memory allocated by these functions must also use ec_free.

Parameters

object_type

One of the memory types enumerated at the section called “Memory Types”.

ptr

A pointer to the memory location.

Return Values

This function returns void.

Threading

It is legal to call this function in any thread.

See Also

Was this page helpful?