From 8d0ed43cfe2dd064465b3f44d0c19e91a985e185 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 18 Feb 2014 14:50:35 -0500 Subject: [PATCH] Bug 974045 - don't store JS_CRASH_DIAGNOSTICS variables when we don't need to; r=luke --- js/src/jscrashreport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/src/jscrashreport.cpp b/js/src/jscrashreport.cpp index 09163c00710..f1bf2be26ef 100644 --- a/js/src/jscrashreport.cpp +++ b/js/src/jscrashreport.cpp @@ -216,31 +216,39 @@ Ring::copyBytes(void *data, size_t size) } /* namespace crash */ } /* namespace js */ +#ifdef JS_CRASH_DIAGNOSTICS static bool gInitialized; static Stack gGCStack(JS_CRASH_STACK_GC); static Stack gErrorStack(JS_CRASH_STACK_ERROR); static Ring gRingBuffer(JS_CRASH_RING); +#endif void js::crash::SnapshotGCStack() { +#ifdef JS_CRASH_DIAGNOSTICS if (gInitialized) gGCStack.snapshot(); +#endif } void js::crash::SnapshotErrorStack() { +#ifdef JS_CRASH_DIAGNOSTICS if (gInitialized) gErrorStack.snapshot(); +#endif } void js::crash::SaveCrashData(uint64_t tag, void *ptr, size_t size) { +#ifdef JS_CRASH_DIAGNOSTICS if (gInitialized) gRingBuffer.push(tag, ptr, size); +#endif } JS_PUBLIC_API(void)