Downsizing memory requirements by better struct packing
This commit is contained in:
parent
3a984668d6
commit
ec3bcb43a8
@ -40,11 +40,8 @@ private:
|
||||
parent = p;
|
||||
}
|
||||
};
|
||||
#ifdef _MANYCORES
|
||||
typedef BinaryHeap< NodeID, NodeID, int, _HeapData, DenseStorage<NodeID, NodeID> > _Heap;
|
||||
#else
|
||||
typedef BinaryHeap< NodeID, NodeID, int, _CleanupHeapData > _Heap;
|
||||
#endif
|
||||
|
||||
struct _ThreadData {
|
||||
_Heap* _heapForward;
|
||||
_Heap* _heapBackward;
|
||||
@ -52,8 +49,7 @@ private:
|
||||
_heapBackward = new _Heap(nodes);
|
||||
_heapForward = new _Heap(nodes);
|
||||
}
|
||||
~_ThreadData()
|
||||
{
|
||||
~_ThreadData() {
|
||||
delete _heapBackward;
|
||||
delete _heapForward;
|
||||
}
|
||||
@ -65,13 +61,13 @@ public:
|
||||
NodeID source;
|
||||
NodeID target;
|
||||
struct EdgeData {
|
||||
NodeID via;
|
||||
unsigned nameID;
|
||||
int distance;
|
||||
bool shortcut;
|
||||
bool forward;
|
||||
bool backward;
|
||||
short turnInstruction;
|
||||
NodeID via;
|
||||
unsigned nameID;
|
||||
int distance;
|
||||
short turnInstruction;
|
||||
bool shortcut:1;
|
||||
bool forward:1;
|
||||
bool backward:1;
|
||||
} data;
|
||||
|
||||
//sorts by source and other attributes
|
||||
|
@ -41,16 +41,15 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
||||
class Contractor {
|
||||
|
||||
private:
|
||||
|
||||
struct _EdgeBasedContractorEdgeData {
|
||||
unsigned distance;
|
||||
unsigned originalEdges;
|
||||
unsigned via;
|
||||
unsigned nameID;
|
||||
bool shortcut;
|
||||
bool forward;
|
||||
bool backward;
|
||||
short turnInstruction;
|
||||
unsigned distance;
|
||||
unsigned originalEdges;
|
||||
unsigned via;
|
||||
unsigned nameID;
|
||||
short turnInstruction;
|
||||
bool shortcut:1;
|
||||
bool forward:1;
|
||||
bool backward:1;
|
||||
} data;
|
||||
|
||||
struct _HeapData {
|
||||
@ -107,7 +106,7 @@ public:
|
||||
|
||||
edge.data.distance = (std::max)((int)i->weight(), 1 );
|
||||
assert( edge.data.distance > 0 );
|
||||
#ifndef NDEBUG
|
||||
#ifdef NDEBUG
|
||||
if ( edge.data.distance > 24 * 60 * 60 * 10 ) {
|
||||
std::cout << "Edge Weight too large -> May lead to invalid CH" << std::endl;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user