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

Method Init

BeefRT/rt/Internal.cpp:329–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void bf::System::Runtime::Init(int version, int flags, BfRtCallbacks* callbacks)
330{
331 BfpSystemInitFlags sysInitFlags = BfpSystemInitFlag_InstallCrashCatcher;
332 if ((flags & 4) != 0)
333 sysInitFlags = (BfpSystemInitFlags)(sysInitFlags | BfpSystemInitFlag_SilentCrash);
334 BfpSystem_Init(BFP_VERSION, sysInitFlags);
335
336 if (gBfRtCallbacks.Alloc != NULL)
337 {
338 Internal_FatalError("BeefRT already initialized. Multiple executable modules in the same process cannot dynamically link to the Beef runtime.");
339 }
340
341 if (version != BFRT_VERSION)
342 {
343 char error[256];
344 sprintf(error, "BeefRT build version '%d' does not match requested version '%d'", BFRT_VERSION, version);
345 BfpSystem_FatalError(error, "BEEF FATAL ERROR");
346 }
347
348 gBfRtCallbacks = *callbacks;
349 gBfRtFlags = (BfRtFlags)flags;
350
351#ifdef BF_PLATFORM_WINDOWS
352 gBfTLSKey = FlsAlloc(TlsFreeFunc);
353#else
354 pthread_key_create(&gBfTLSKey, TlsFreeFunc);
355#endif
356}
357
358void bf::System::Runtime::InitCrashCatcher(int flags)
359{

Callers

nothing calls this directly

Calls 3

Internal_FatalErrorFunction · 0.85
BfpSystem_InitFunction · 0.50
BfpSystem_FatalErrorFunction · 0.50

Tested by

no test coverage detected