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 #ifndef JUNCTION_EXTRA_IMPL_MAPADAPTER_CRUDE_H
14 #define JUNCTION_EXTRA_IMPL_MAPADAPTER_CRUDE_H
16 #include <junction/Core.h>
17 #include <junction/ConcurrentMap_Crude.h>
18 #include <turf/Util.h>
25 static TURF_CONSTEXPR const char* MapName = "Junction Crude map";
32 ThreadContext(MapAdapter&, ureg) {
35 void registerThread() {
38 void unregisterThread() {
45 typedef ConcurrentMap_Crude<u32, void*> Map;
47 static ureg getInitialCapacity(ureg maxPopulation) {
48 return turf::util::roundUpPowerOf2(ureg(maxPopulation * 1.25f));
53 } // namespace junction
55 #endif // JUNCTION_EXTRA_IMPL_MAPADAPTER_CRUDE_H