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)
commitc83c993a9551b36d06eaa9004c781943dddf61d9
treeecd641e5db1730fd1d80fad9373c0ee807fabf45
parent33112caf70a3ab3ebdaa4a31a9294c670c0a51ae
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: https://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]