MCPcopy Create free account
hub / github.com/beefytech/Beef / SetErrorString

Function SetErrorString

BeefRT/rt/Internal.cpp:261–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259static const char* volatile gErrorString = NULL;
260
261void SetErrorString(const char* str)
262{
263 char* newStr = strdup(str);
264 while (true)
265 {
266 const char* prevStr = gErrorString;
267 auto result = (void*)BfpSystem_InterlockedCompareExchangePtr((uintptr*)&gErrorString, (uintptr)prevStr, (uintptr)newStr);
268 if (result != prevStr)
269 continue;
270 if (prevStr != NULL)
271 free((void*)prevStr);
272 break;
273 }
274}
275
276#define SETUP_ERROR(str, skip) SetErrorString(str); gBfRtCallbacks.DebugMessageData_SetupError(str, skip)
277

Callers 1

SetErrorStringMethod · 0.85

Calls 2

strdupFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected