From: Lucian Grijincu Date: Wed, 27 Jan 2016 22:33:34 +0000 (-0800) Subject: folly: ubsan: reduce vector size to avoid UBSAN timeout X-Git-Tag: deprecate-dynamic-initializer~135 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94174b55501a035ca9676bb4b3b70717ab455152;p=folly.git folly: ubsan: reduce vector size to avoid UBSAN timeout Summary: Based on diff where this was introduced in {D360195} it seems like ``` // This value should we multiple of word size. static size_t const kHeapifyCapacitySize = sizeof( typename std::aligned_storage< sizeof(InternalSizeType), alignof(value_type) >::type); // Threshold to control capacity heapifying. static size_t const kHeapifyCapacityThreshold = 100 * kHeapifyCapacitySize; ``` So anything above 100*sizeof(SizeType) should do. Reviewed By: philippv Differential Revision: D2871422 fb-gh-sync-id: a69e47286c53887ac05e89dab565b9d609e183a0 --- diff --git a/folly/test/small_vector_test.cpp b/folly/test/small_vector_test.cpp index 746fc27f..76b20ef5 100644 --- a/folly/test/small_vector_test.cpp +++ b/folly/test/small_vector_test.cpp @@ -663,7 +663,7 @@ TEST(small_vector, Capacity) { // Test capacity heapifying logic folly::small_vector vec3; - const size_t hc_size = 1000000; + const size_t hc_size = 100000; for (size_t i = 0; i < hc_size; ++i) { auto v = (unsigned char)i; vec3.push_back(v);