MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_wcsdup

Function mi_wcsdup

3rd/mimalloc-2.0.9/src/alloc-posix.c:126–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126mi_decl_nodiscard mi_decl_restrict unsigned short* mi_wcsdup(const unsigned short* s) mi_attr_noexcept {
127 if (s==NULL) return NULL;
128 size_t len;
129 for(len = 0; s[len] != 0; len++) { }
130 size_t size = (len+1)*sizeof(unsigned short);
131 unsigned short* p = (unsigned short*)mi_malloc(size);
132 if (p != NULL) {
133 _mi_memcpy(p,s,size);
134 }
135 return p;
136}
137
138mi_decl_nodiscard mi_decl_restrict unsigned char* mi_mbsdup(const unsigned char* s) mi_attr_noexcept {
139 return (unsigned char*)mi_strdup((const char*)s);

Callers 1

mi_wdupenv_sFunction · 0.85

Calls 2

mi_mallocFunction · 0.85
_mi_memcpyFunction · 0.85

Tested by

no test coverage detected