Add tar file mmaping

This commit is contained in:
Patrick Niklaus
2018-03-22 15:40:57 +00:00
parent a52213c885
commit bde51a9ef5
2 changed files with 52 additions and 2 deletions
+8 -2
View File
@@ -18,6 +18,7 @@
#include "util/for_each_pair.hpp"
#include "util/integer_range.hpp"
#include "util/log.hpp"
#include "util/mmap_tar.hpp"
#include "util/opening_hours.hpp"
#include "util/static_graph.hpp"
#include "util/static_rtree.hpp"
@@ -435,8 +436,13 @@ updateTurnPenalties(const UpdaterConfig &config,
// Mapped file pointer for turn indices
boost::iostreams::mapped_file_source turn_index_region;
auto turn_index_blocks = util::mmapFile<extractor::lookup::TurnIndexBlock>(
config.GetPath(".osrm.turn_penalties_index"), turn_index_region);
const extractor::lookup::TurnIndexBlock *turn_index_blocks;
{
auto map =
util::mmapTarFile(config.GetPath(".osrm.turn_penalties_index"), turn_index_region);
turn_index_blocks =
reinterpret_cast<const extractor::lookup::TurnIndexBlock *>(map["/extractor/turn_index"].first);
}
// Get the turn penalty and update to the new value if required
std::vector<std::uint64_t> updated_turns;