Name
ec_mt_strdup — Duplicate a string of the specified memory type
Synopsis
#include "ec_malloc.h"
| **ec_mt_strdup** (
| object_type, | |
| | str)
; | |
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)
.
- object_type
-
This parameter is an integer indicating a specific memory type.
- str
-
A pointer to the string you wish to duplicate.
This function returns a pointer to the duplicated string.
It is legal to call this function in the any
thread.