Hi Klaus, IIRC, the memset needs to zeros the first part of the first part (the routeNodes), because it allows the AddNd loop to know if routeNodeType has been taken (allocated). The routeHeap can remain uninitialized, because it is always filled from the front. So your patch is good, but I would write
+ memset (route, 0, sizeof (*route) * dhashSize); Note that sizeof (*route) = 24 on 32 bit machines and sizeof (dhashSize)=4 So David, I guess the only bug may that the program think that only 1/6 th of its hash table is useable and gives up too early on some queries. And I would be really pleased if it solves a lot of problems with yournavigation. Regard, Nic On Mon, Jun 22, 2009 at 11:47 AM, Klaus Rechert < [email protected]> wrote: > Hi, > > this is not quite the right list for technical issues, but I haven't > found a dedicated gosmore list. bugfix below. > > cheers > Klaus > > > > Index: libgosm.cpp > =================================================================== > --- libgosm.cpp (Revision 15955) > +++ libgosm.cpp (Arbeitskopie) > @@ -480,7 +480,7 @@ > malloc ((sizeof (*route) + sizeof (*routeHeap)) * dhashSize))) { > dhashSize = dhashSize / 4 * 3; > } > - memset (route, 0, sizeof (dhashSize) * dhashSize); > + memset (route, 0, (sizeof (*route) + sizeof (*routeHeap)) * > dhashSize); > #endif > routeHeapSize = 1; /* Leave position 0 open to simplify the math */ > routeHeap = (routeNodeType**) (route + dhashSize) - 1; > > > _______________________________________________ > Routing mailing list > [email protected] > http://lists.openstreetmap.org/listinfo/routing >
_______________________________________________ Routing mailing list [email protected] http://lists.openstreetmap.org/listinfo/routing
