Skip to main content

Name

ec_mt_strdup — Duplicate a string of the specified memory type

Synopsis

#include "ec_malloc.h"

| **ec_mt_strdup** ( | object_type, |   | |   | str); |   |

int <var class="pdparam">object_type</var>; const char * <var class="pdparam">str</var>;

Description

Duplicate a string of the specified memory type. The built-in memtypes are enumerated at the section called “Memory Types”. To create your own memory type use ec_memtype_register.

Note

This function is only valid with VSIZE memory type, not a fixed size type. For more information about memory types see Memory Types.

The ec_strdup(str) function is a macro for duplicating a string of the MEMTYPE_MESSAGE_BODY type: It calls ec_mt_strdup(MEMTYPE_MESSAGE_BODY, __str).

Parameters

object_type

This parameter is an integer indicating a specific memory type.

str

A pointer to the string you wish to duplicate.

Return Value

This function returns a pointer to the duplicated string.

Threading

It is legal to call this function in the any thread.

See Also

Was this page helpful?