Bug 1413475 - Inline STRERROR_BUF in mozjemalloc.cpp. r?njn
It is only used once.
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -244,19 +244,16 @@ static inline void*
#endif
#endif
}
#define mmap _mmap
#define munmap(a, l) syscall(SYS_munmap, a, l)
#endif
#endif
-// Size of stack-allocated buffer passed to strerror_r().
-#define STRERROR_BUF 64
-
// Minimum alignment of non-tiny allocations is 2^QUANTUM_2POW_MIN bytes.
#define QUANTUM_2POW_MIN 4
// sizeof(int) == (1U << SIZEOF_INT_2POW).
#ifndef SIZEOF_INT_2POW
#define SIZEOF_INT_2POW 2
#endif
@@ -1546,17 +1543,17 @@ pages_unmap(void* aAddr, size_t aSize)
}
}
#else
static void
pages_unmap(void* aAddr, size_t aSize)
{
if (munmap(aAddr, aSize) == -1) {
- char buf[STRERROR_BUF];
+ char buf[64];
if (strerror_r(errno, buf, sizeof(buf)) == 0) {
_malloc_message(
_getprogname(), ": (malloc) Error in munmap(): ", buf, "\n");
}
}
}