MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / errorImpl

Method errorImpl

physx/source/foundation/src/PsFoundation.cpp:104–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void Foundation::errorImpl(PxErrorCode::Enum e, const char* file, int line, const char* messageFmt, va_list va)
105{
106 PX_ASSERT(messageFmt);
107 if(e & mErrorMask)
108 {
109 // this function is reentrant but user's error callback may not be, so...
110 Mutex::ScopedLock lock(mErrorMutex);
111
112 // using a static fixed size buffer here because:
113 // 1. vsnprintf return values differ between platforms
114 // 2. va_start is only usable in functions with ellipses
115 // 3. ellipses (...) cannot be passed to called function
116 // which would be necessary to dynamically grow the buffer here
117
118 static const size_t bufSize = 1024;
119 char stringBuffer[bufSize];
120 shdfnd::vsnprintf(stringBuffer, bufSize, messageFmt, va);
121
122 mBroadcastingError.reportError(e, stringBuffer, file, line);
123 }
124}
125
126Foundation* Foundation::createInstance(PxU32 version, PxErrorCallback& errc, PxAllocatorCallback& alloc)
127{

Callers 1

displayMessageMethod · 0.80

Calls 2

vsnprintfFunction · 0.85
reportErrorMethod · 0.45

Tested by

no test coverage detected