MCPcopy Create free account
hub / github.com/defold/defold / GetProfilerString

Function GetProfilerString

engine/dlib/src/dlib/message.cpp:532–543  ·  view source on GitHub ↗

Low level string concatenation to avoid the overhead of dmSnPrintf and having to call strlen

Source from the content-addressed store, hash-verified

530
531 // Low level string concatenation to avoid the overhead of dmSnPrintf and having to call strlen
532 static const char* GetProfilerString(const char* socket_name, char* buffer, uint32_t buffer_size)
533 {
534 if (!ProfileIsInitialized())
535 return 0;
536
537 char* w_ptr = buffer;
538 const char* w_ptr_end = buffer + buffer_size - 1;
539 w_ptr = ConcatString(w_ptr, w_ptr_end, "Dispatch ");
540 w_ptr = ConcatString(w_ptr, w_ptr_end, socket_name);
541 *w_ptr++ = 0;
542 return buffer;
543 }
544
545 uint32_t InternalDispatch(HSocket socket, DispatchCallback dispatch_callback, void* user_ptr, bool blocking)
546 {

Callers 1

InternalDispatchFunction · 0.70

Calls 2

ConcatStringFunction · 0.70
ProfileIsInitializedFunction · 0.50

Tested by

no test coverage detected