Skip to content

Commit be5c3e4

Browse files
committed
Replace sizeof asserts with warning on Windows
1 parent 3282d41 commit be5c3e4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

prepare.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,12 @@ int main(int argc, char *argv[])
261261

262262
speed_profile.has_turn_penalty_function = lua_function_exists(lua_state, "turn_function");
263263

264+
#ifdef WIN32
265+
#pragma message ("Memory consumption on Windows can be higher due to memory alignment")
266+
#else
264267
static_assert(sizeof(ImportEdge) == 20,
265268
"changing ImportEdge type has influence on memory consumption!");
269+
#endif
266270
std::vector<ImportEdge> edge_list;
267271
NodeID number_of_node_based_nodes =
268272
readBinaryOSRMGraphFromStream(in,
@@ -314,8 +318,10 @@ int main(int argc, char *argv[])
314318
unsigned number_of_edge_based_nodes = edge_based_graph_factor->GetNumberOfEdgeBasedNodes();
315319
BOOST_ASSERT(number_of_edge_based_nodes != std::numeric_limits<unsigned>::max());
316320
DeallocatingVector<EdgeBasedEdge> edgeBasedEdgeList;
321+
#ifndef WIN32
317322
static_assert(sizeof(EdgeBasedEdge) == 16,
318323
"changing ImportEdge type has influence on memory consumption!");
324+
#endif
319325

320326
edge_based_graph_factor->GetEdgeBasedEdges(edgeBasedEdgeList);
321327
std::vector<EdgeBasedNode> node_based_edge_list;

0 commit comments

Comments
 (0)