FastLED 3.9.15
Loading...
Searching...
No Matches

◆ grow()

void fl::StringHolder::grow ( size newLength)

Definition at line 43 of file string_holder.cpp.hpp.

43 {
44 if (newLength + 1 <= mCapacity) {
45 // We have enough capacity for newLength + null terminator
46 mLength = newLength;
47 mData[mLength] = '\0';
48 return;
49 }
50
51 // Use fl::realloc for efficient growth without memory move
52 // fl::realloc may expand in place or copy to larger block as needed
53 mData = (char*)fl::realloc(mData, newLength + 1);
54 mLength = newLength;
55 mCapacity = newLength + 1;
56 mData[mLength] = '\0'; // Ensure null-termination
57}
void * realloc(void *ptr, size_t new_size)

References mCapacity, mData, mLength, and fl::realloc().

Referenced by operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: