MCPcopy Create free account
hub / github.com/ZDoom/Raze / ReallocBuffer

Method ReallocBuffer

source/common/utility/zstring.cpp:1229–1246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227}
1228
1229void FString::ReallocBuffer (size_t newlen)
1230{
1231 if (Data()->RefCount > 1)
1232 { // If more than one reference, we must use a new copy
1233 FStringData *old = Data();
1234 AllocBuffer (newlen);
1235 StrCopy (Chars, old->Chars(), newlen < old->Len ? newlen : old->Len);
1236 old->Release();
1237 }
1238 else
1239 {
1240 if (newlen > Data()->AllocLen)
1241 {
1242 Chars = (char *)(Data()->Realloc(newlen) + 1);
1243 }
1244 Data()->Len = (unsigned int)newlen;
1245 }
1246}
1247
1248TArray<FString> FString::Split(const FString &delimiter, const EmptyTokenType keepEmpty) const
1249{

Callers 1

FormatHelperMethod · 0.80

Calls 3

CharsMethod · 0.80
ReleaseMethod · 0.45
ReallocMethod · 0.45

Tested by

no test coverage detected