memgraph/tests/concurrent/sl_memory.cpp
Kruno Tomola Fabro ac7f6f507f Implemented ConncurentMap and updated it's users.
Added tests for ConcurrentMap.
Implemented ~SkipList.
2016-07-30 21:20:21 +01:00

22 lines
447 B
C++

#include "common.h"
#define THREADS_NO 8
constexpr size_t elements = 2e6;
// Test for simple memory leaks
int main() {
memory_check(THREADS_NO, [] {
skiplist_t skiplist;
auto futures = run<size_t>(THREADS_NO, skiplist, [](auto acc, auto index) {
for (size_t i = 0; i < elements; i++) {
acc.insert(i, index);
}
return index;
});
collect(futures);
check_size(skiplist.access(), elements);
});
}