MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / wrtmessage

Function wrtmessage

deps/memkind/src/jemalloc/src/malloc_io.c:71–87  ·  view source on GitHub ↗

malloc_message() setup. */

Source from the content-addressed store, hash-verified

69
70/* malloc_message() setup. */
71static void
72wrtmessage(void *cbopaque, const char *s) {
73#if defined(JEMALLOC_USE_SYSCALL) && defined(SYS_write)
74 /*
75 * Use syscall(2) rather than write(2) when possible in order to avoid
76 * the possibility of memory allocation within libc. This is necessary
77 * on FreeBSD; most operating systems do not have this problem though.
78 *
79 * syscall() returns long or int, depending on platform, so capture the
80 * unused result in the widest plausible type to avoid compiler
81 * warnings.
82 */
83 UNUSED long result = syscall(SYS_write, STDERR_FILENO, s, strlen(s));
84#else
85 UNUSED ssize_t result = write(STDERR_FILENO, s, strlen(s));
86#endif
87}
88
89JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s);
90

Callers 1

malloc_writeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected