Erik Hofman writes:

 > > I just wrote a short ANSI C++ test program to read the airport
 > > database from the text file into an in-memory hash table.  The basic
 > 
 > Do you have any idea if the mmap() function is available on all 
 > platforms? This is basically like a one shot read of the airports file 
 > into memory (but instead leaving it on the drive). It would be easy to 
 > search the memory location then.

I think that mmap is Unix only; in any case, it looks like the stdio
solution is fast enough (just over 1 second to load the database).
I'd estimate that the memory overhead is about 20 bytes/airport plus
about the same per runway; if the 16,000 or so airports average 2
runways each, that means that we need around 1MB of memory to hold the
entire airport database (I think that the average is probably under 2
runways, but I want to be conservative).


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to