1 /*------------------------------------------------------------------------
2 Junction: Concurrent data structures in C++
3 Copyright (c) 2016 Jeff Preshing
5 Distributed under the Simplified BSD License.
6 Original location: https://github.com/preshing/junction
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the LICENSE file for more information.
11 ------------------------------------------------------------------------*/
13 #include <junction/Core.h>
14 #include <turf/Heap.h>
15 #include <junction/extra/MapAdapter.h>
18 using namespace turf::intTypes;
21 junction::extra::MapAdapter adapter(1);
22 junction::extra::MapAdapter::ThreadContext context(adapter, 0);
23 junction::extra::MapAdapter::Map map(65536);
26 for (ureg i = 0; i < 100; i++) {
27 #if TURF_USE_DLMALLOC && TURF_DLMALLOC_FAST_STATS
28 std::cout << "Population=" << population << ", inUse=" << TURF_HEAP.getInUseBytes() << std::endl;
30 for (; population < i * 5000; population++)
31 map.insert(population + 1, (void*) ((population << 2) | 3));