MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / wstring_alloc

Function wstring_alloc

dds/FACE/StringManager.cpp:41–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40#ifdef DDS_HAS_WCHAR
41WChar* wstring_alloc(UnsignedLong len)
42{
43 if (len == 0) return &s_wempty;
44 const size_t n = (len + 1) * sizeof(WChar);
45 void* const raw = ACE_Allocator::instance()->malloc(n);
46 WChar* const str = static_cast<WChar*>(raw);
47 if (str) str[0] = static_cast<WChar>(0);
48 return str;
49}
50
51WChar* wstring_dup(const WChar* str)
52{

Callers 1

wstring_dupFunction · 0.70

Calls 2

instanceFunction · 0.85
mallocMethod · 0.45

Tested by

no test coverage detected