aboutsummaryrefslogtreecommitdiff
path: root/dep/jemalloc/src/malloc_io.c
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2018-05-11 20:36:14 +0200
committerShauren <shauren.trinity@gmail.com>2021-09-26 20:50:35 +0200
commit501bb9dc6702f8130ccd077bad30828705454a01 (patch)
treec092752bb73ed7ef212ad31516e08e23e2eb123c /dep/jemalloc/src/malloc_io.c
parent9c65f4e27c360464869dc401453ebc5c7ba3d78b (diff)
Dep/Jemalloc: Update to Jemalloc 5.1.0
(cherry picked from commit 8fe74bf0f90aab0b23d5ff21079cba4201bb4fdf)
Diffstat (limited to 'dep/jemalloc/src/malloc_io.c')
-rw-r--r--dep/jemalloc/src/malloc_io.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/dep/jemalloc/src/malloc_io.c b/dep/jemalloc/src/malloc_io.c
index 6b99afcd3fc..7bdc13f9519 100644
--- a/dep/jemalloc/src/malloc_io.c
+++ b/dep/jemalloc/src/malloc_io.c
@@ -70,20 +70,7 @@ static char *x2s(uintmax_t x, bool alt_form, bool uppercase, char *s,
/* malloc_message() setup. */
static void
wrtmessage(void *cbopaque, const char *s) {
-#if defined(JEMALLOC_USE_SYSCALL) && defined(SYS_write)
- /*
- * Use syscall(2) rather than write(2) when possible in order to avoid
- * the possibility of memory allocation within libc. This is necessary
- * on FreeBSD; most operating systems do not have this problem though.
- *
- * syscall() returns long or int, depending on platform, so capture the
- * unused result in the widest plausible type to avoid compiler
- * warnings.
- */
- UNUSED long result = syscall(SYS_write, STDERR_FILENO, s, strlen(s));
-#else
- UNUSED ssize_t result = write(STDERR_FILENO, s, strlen(s));
-#endif
+ malloc_write_fd(STDERR_FILENO, s, strlen(s));
}
JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s);
@@ -111,7 +98,7 @@ buferror(int err, char *buf, size_t buflen) {
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
(LPSTR)buf, (DWORD)buflen, NULL);
return 0;
-#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
+#elif defined(JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE) && defined(_GNU_SOURCE)
char *b = strerror_r(err, buf, buflen);
if (b != buf) {
strncpy(buf, b, buflen);