Bug 1411201 - Don't disable inlining in mozjemalloc on debug builds. r?njn draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 24 Oct 2017 18:42:24 +0900
changeset 685269 7d10616023fe381e9490692620c5d3e31f8dddc6
parent 685268 bc0dac15135529e6505a6398ae2a6736397540a9
child 685593 350ae4a9ffdc9aa4a248939e295e23b2988fb5d0
push id85886
push userbmo:mh+mozilla@glandium.org
push dateTue, 24 Oct 2017 09:48:03 +0000
reviewersnjn
bugs1411201
milestone58.0a1
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.
memory/build/mozjemalloc.cpp
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -293,25 +293,16 @@ void *_mmap(void *addr, size_t length, i
 #endif
 #endif
 }
 #define mmap _mmap
 #define munmap(a, l) syscall(SYS_munmap, a, l)
 #endif
 #endif
 
-#ifdef MOZ_DEBUG
-   /* Disable inlining to make debugging easier. */
-#ifdef inline
-#undef inline
-#endif
-
-#  define inline
-#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
 #if defined(_WIN64) || defined(__LP64__)
 #  define SIZEOF_PTR_2POW       3
 #else