MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_vfprintf

Function mi_vfprintf

3rd/mimalloc-2.0.9/src/options.c:345–352  ·  view source on GitHub ↗

Define our own limited `fprintf` that avoids memory allocation. We do this using `snprintf` with a limited buffer.

Source from the content-addressed store, hash-verified

343// Define our own limited `fprintf` that avoids memory allocation.
344// We do this using `snprintf` with a limited buffer.
345static void mi_vfprintf( mi_output_fun* out, void* arg, const char* prefix, const char* fmt, va_list args ) {
346 char buf[512];
347 if (fmt==NULL) return;
348 if (!mi_recurse_enter()) return;
349 vsnprintf(buf,sizeof(buf)-1,fmt,args);
350 mi_recurse_exit();
351 _mi_fputs(out,arg,prefix,buf);
352}
353
354void _mi_fprintf( mi_output_fun* out, void* arg, const char* fmt, ... ) {
355 va_list args;

Callers 3

_mi_fprintfFunction · 0.85
mi_vfprintf_threadFunction · 0.85
_mi_verbose_messageFunction · 0.85

Calls 3

mi_recurse_enterFunction · 0.85
mi_recurse_exitFunction · 0.85
_mi_fputsFunction · 0.85

Tested by

no test coverage detected