Bug 1411201 - Don't disable inlining in mozjemalloc on debug builds. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 24 Oct 2017 18:42:24 +0900
changeset 685835 43695cf06e96ffae6c50321371fa37c43f5ca3b4
parent 685834 b06e3211aae4c42509d4e897f2d91cd06ede314f
child 685836 396203b98e350e0e52111423a8e04080c0ea60ef
push id86016
push userkgupta@mozilla.com
push dateWed, 25 Oct 2017 01:53:44 +0000
Bug 1411201 - Don't disable inlining in mozjemalloc on debug builds. r=njn The way inlining is disabled in mozjemalloc is via a #define of "inline" to nothing, which is a dubious way to do that. This makes the compiler trigger warnings we -Werror on for some static functions. While there are such functions in mozjemalloc.cpp that could be fixed by wrapping them in the right #ifdefs, there are also others coming from headers, and it's not something that can be fixed in a satisfactory way. The right way to disable inlining is to pass the right compiler flags for that. But inlining is the least of the problems to debug optimized C++ code, so it feels like if debugging requires some optimization tweaking, it should be done manually with compile flags when needed, instead of fiddling with #defines to remove keywords.
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -293,25 +293,16 @@ void *_mmap(void *addr, size_t length, i
 #define mmap _mmap
 #define munmap(a, l) syscall(SYS_munmap, a, l)
-#ifdef MOZ_DEBUG
-   /* Disable inlining to make debugging easier. */
-#ifdef inline
-#undef inline
-#  define inline
 /* 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
 #if defined(_WIN64) || defined(__LP64__)
 #  define SIZEOF_PTR_2POW       3