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
5 files changed