| 64 | void malloc_printf(const char *format, ...) JEMALLOC_FORMAT_PRINTF(1, 2); |
| 65 | |
| 66 | static inline ssize_t |
| 67 | malloc_write_fd(int fd, const void *buf, size_t count) { |
| 68 | #if defined(JEMALLOC_USE_SYSCALL) && defined(SYS_write) |
| 69 | /* |
| 70 | * Use syscall(2) rather than write(2) when possible in order to avoid |
| 71 | * the possibility of memory allocation within libc. This is necessary |
| 72 | * on FreeBSD; most operating systems do not have this problem though. |
| 73 | * |
| 74 | * syscall() returns long or int, depending on platform, so capture the |
| 75 | * result in the widest plausible type to avoid compiler warnings. |
| 76 | */ |
| 77 | long result = syscall(SYS_write, fd, buf, count); |
| 78 | #else |
| 79 | ssize_t result = (ssize_t)write(fd, buf, |
| 80 | #ifdef _WIN32 |
| 81 | (unsigned int) |
| 82 | #endif |
| 83 | count); |
| 84 | #endif |
| 85 | return (ssize_t)result; |
| 86 | } |
| 87 | |
| 88 | static inline ssize_t |
| 89 | malloc_read_fd(int fd, void *buf, size_t count) { |
no outgoing calls