MallocBench should have a stress test for correctness
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 20:59:58 +0000 (20:59 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 20:59:58 +0000 (20:59 +0000)
commit0814f37d443976ed9d148d9935942c4a6121163f
treeecd641e5db1730fd1d80fad9373c0ee807fabf45
parent834a43d4d371e18e2f6fec135b08fbe1b9d3767c
MallocBench should have a stress test for correctness
https://bugs.webkit.org/show_bug.cgi?id=136468

Reviewed by Andreas Kling.

Added a stress test that allocates randomized sizes of randomized
lifetimes in randomized order.

This version of the test reproduces the EWS crash seen in bmalloc
(<https://bugs.webkit.org/show_bug.cgi?id=132629>).

* MallocBench/MallocBench.xcodeproj/project.pbxproj:
* MallocBench/MallocBench/Benchmark.cpp: Sort!
* MallocBench/MallocBench/stress.cpp: Added.
(Object::Object):
(SizeStream::SizeStream):
(SizeStream::next):
(benchmark_stress): Usually, we random(0). Surprisingly, though, only
random(1) reproduces the bug I was looking for.
* MallocBench/MallocBench/stress.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj
PerformanceTests/MallocBench/MallocBench/Benchmark.cpp
PerformanceTests/MallocBench/MallocBench/stress.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/stress.h [new file with mode: 0644]