[PATCH] D16419: Use std::piecewise_constant_distribution instead of ad-hoc binary search.

Ivan Krasin via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:20:21 PST 2016


krasin added inline comments.

================
Comment at: lib/Fuzzer/FuzzerLoop.cpp:511
@@ +510,3 @@
+  for (size_t i = 0; i < Corpus.size(); i++) {
+    Intervals[i+1] = i+1;
+    Weights[i] = i+1;
----------------
kcc wrote:
> yep, iota would be nicer. 
> Also, the current code does not initialize Intervals[0]
> yep, iota would be nicer. 
Done

>Also, the current code does not initialize Intervals[0]
explicit vector(size_type count) constructor initializes Intervals with all zeros.

================
Comment at: lib/Fuzzer/test/FuzzerUnittest.cpp:410
@@ +409,3 @@
+  size_t N = 10;
+  size_t TriesPerUnit = 1E6;
+  for (size_t i = 0; i < N; i++) {
----------------
kcc wrote:
> why cast from double from size_t. 
> Better just write 1 << 20. 
Sorry, I don't understand which cast do you mean here. The function does not cast from double to size_t anywhere.


http://reviews.llvm.org/D16419





More information about the llvm-commits mailing list