Handle 32bit to not allocate way to mcuch.

This commit is contained in:
Matthew Parkinson
2019-07-10 16:01:17 +01:00
parent c2785ec661
commit c1c9237b8d

View File

@@ -18,8 +18,14 @@ namespace test
{
size_t rand = (size_t)r.next();
size_t offset = bits::clz(rand);
if (offset > 30)
offset = 30;
if constexpr (bits::is64())
{
if (offset > 30)
offset = 30;
}
else if (offset > 20)
offset = 20;
size_t size = (rand & 15) << offset;
if (size < 16)
size = 16;