MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / vssappendf

Function vssappendf

pcsx2/DebugTools/DisR5900asm.cpp:16–37  ·  view source on GitHub ↗

Note: Perf is not important

Source from the content-addressed store, hash-verified

14
15// Note: Perf is not important
16static void vssappendf(std::string &dest, const char *format, va_list args)
17{
18 char first_try[128]; // this function is called 99% (100%?) of the times for small string
19 va_list args_copy;
20 va_copy(args_copy, args);
21
22 s32 size = std::vsnprintf(first_try, 128, format, args_copy) + 1;
23
24 va_end(args_copy);
25
26 if (size < 0)
27 return;
28 if (size < 128) {
29 dest += first_try;
30 return;
31 }
32
33 std::vector<char> output(size + 1);
34 std::vsnprintf(output.data(), size, format, args);
35
36 dest += output.data();
37}
38
39void ssappendf(std::string &dest, const char *format, ...)
40{

Callers 1

ssappendfFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected