MCPcopy Create free account
hub / github.com/FastLED/FastLED / StringHolder

Method StringHolder

src/fl/stl/detail/string_holder.cpp.hpp:16–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14// Assumes fl::malloc/fl::realloc/fl::free cannot return NULL (OOM is terminal)
15
16StringHolder::StringHolder(const char *str)
17 : mData((char*)fl::malloc(strlen(str) + 1))
18 , mLength(strlen(str))
19 , mCapacity(mLength + 1) {
20 fl::memcpy(mData, str, mLength);
21 mData[mLength] = '\0';
22}
23
24StringHolder::StringHolder(size length)
25 : mData((char*)fl::malloc(length + 1))

Callers

nothing calls this directly

Calls 3

strlenFunction · 0.85
mallocFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected