malloc_message() setup. */
| 69 | |
| 70 | /* malloc_message() setup. */ |
| 71 | static void |
| 72 | wrtmessage(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 | |
| 89 | JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); |
| 90 |