Index: Source/wtf/Assertions.cpp |
diff --git a/Source/wtf/Assertions.cpp b/Source/wtf/Assertions.cpp |
index f7884df401262723d6b59a4c704cdec2c40f3f06..5873c517b6a0eed17c601e381cf2520707c09f6f 100644 |
--- a/Source/wtf/Assertions.cpp |
+++ b/Source/wtf/Assertions.cpp |
@@ -249,11 +249,11 @@ void WTFGetBacktrace(void** stack, int* size) |
#endif |
} |
-void WTFReportBacktrace() |
+void WTFReportBacktrace(int framesToShow) |
{ |
- static const int framesToShow = 31; |
static const int framesToSkip = 2; |
- void* samples[framesToShow + framesToSkip]; |
+ // Use alloca to allocate on the stack since this function is used in OOM situations. |
+ void** samples = static_cast<void**>(alloca((framesToShow + framesToSkip) * sizeof(void *))); |
int frames = framesToShow + framesToSkip; |
WTFGetBacktrace(samples, &frames); |