diff --git a/src/test/func/statistics/stats.cc b/src/test/func/statistics/stats.cc new file mode 100644 index 0000000..76ac2f1 --- /dev/null +++ b/src/test/func/statistics/stats.cc @@ -0,0 +1,41 @@ +#include + + + +int main() +{ + snmalloc::Alloc* a = snmalloc::ThreadAlloc::get(); + bool result; + + auto r = a->alloc(16); + + snmalloc::current_alloc_pool()->debug_check_empty(&result); + if (result != false) + { + abort(); + } + + a->dealloc(r); + + snmalloc::current_alloc_pool()->debug_check_empty(&result); + if (result != true) + { + abort(); + } + + r = a->alloc(16); + + snmalloc::current_alloc_pool()->debug_check_empty(&result); + if (result != false) + { + abort(); + } + + a->dealloc(r); + + snmalloc::current_alloc_pool()->debug_check_empty(&result); + if (result != true) + { + abort(); + } +} \ No newline at end of file