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

Method LockBuffer

source/common/utility/zstring.cpp:171–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171char *FString::LockBuffer()
172{
173 if (Data()->RefCount == 1)
174 { // We're the only user, so we can lock it straight away
175 Data()->RefCount = -1;
176 }
177 else if (Data()->RefCount < -1)
178 { // Already locked; just add to the lock count
179 Data()->RefCount--;
180 }
181 else
182 { // Somebody else is also using this character buffer, so create a copy
183 FStringData *old = Data();
184 AllocBuffer (old->Len);
185 StrCopy (Chars, old->Chars(), old->Len);
186 old->Release();
187 Data()->RefCount = -1;
188 }
189 return Chars;
190}
191
192void FString::UnlockBuffer()
193{

Callers 7

SubstituteAliasParamsFunction · 0.80
C_DoKeyFunction · 0.80
PrepareScriptMethod · 0.80
LoadMethod · 0.80
RemoveLegacyUserUniformsFunction · 0.80
RemoveSamplerBindingsFunction · 0.80
RemoveLayoutLocationDeclFunction · 0.80

Calls 2

CharsMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected