From d6bae72b20105bf131002484c2f61e118c9e5199 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 22 Jul 2021 09:53:47 +0100 Subject: [PATCH] Improve debugging for fixed_region --- src/test/func/fixed_region/fixed_region.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/func/fixed_region/fixed_region.cc b/src/test/func/fixed_region/fixed_region.cc index b2350a9..ed5ca3d 100644 --- a/src/test/func/fixed_region/fixed_region.cc +++ b/src/test/func/fixed_region/fixed_region.cc @@ -1,5 +1,6 @@ #include "mem/fixedglobalconfig.h" #include "mem/globalconfig.h" +#include "test/setup.h" #include #include @@ -17,6 +18,7 @@ using FixedAlloc = LocalAllocator; int main() { #ifndef SNMALLOC_PASS_THROUGH // Depends on snmalloc specific features + setup(); // 28 is large enough to produce a nested allocator. // It is also large enough for the example to run in. @@ -34,11 +36,18 @@ int main() size_t object_size = 128; size_t count = 0; + size_t i = 0; while (true) { auto r1 = a.alloc(object_size); count += object_size; + i++; + if (i == 1024) + { + i = 0; + std::cout << "."; + } // Run until we exhaust the fixed region. // This should return null. if (r1 == nullptr)