flightaware / speedtables

Speed tables is a high-performance memory-resident database. The speed table compiler reads a table definition and generates a set of C access routines to create, manipulate and search tables containing millions of rows. Currently oriented towards Tcl.
https://flightaware.github.io/speedtables/
BSD 3-Clause "New" or "Revised" License
65 stars 15 forks source link

Mapped file base address is not honored #46

Open bovine opened 9 years ago

bovine commented 9 years ago

Karl reports that the base address specified for the memory mapped file may not be actually honored and that a self-assigned address is used instead.

gahr commented 9 years ago

I haven't looked at the code, but the MAP_FIXED flag to mmap comes to mind. Is that used already?

resuna commented 9 years ago

I had that in the original code.

if(addr == (char *)-1)
    addr = 0;
if(addr) flags |= MAP_FIXED;
map = mmap(addr, size, PROT_READ|PROT_WRITE, flags, fd, (off_t) 0);

It now looks like it's calling a BOOST API that may not provide as much control:

include <boost/interprocess/managed_mapped_file.hpp>

...

if (create != 0) { mmf = new managed_mapped_file(open_or_create, file, defaultsize, (void)addr); } else { mmf = new managed_mapped_file(openonly, file, (void)addr); } Need to check what Boost is doing.

On Wed, Jan 7, 2015 at 2:24 AM, Pietro Cerutti notifications@github.com wrote:

I haven't looked at the code, but the MAP_FIXED flag to mmap comes to mind. Is that used already?

— Reply to this email directly or view it on GitHub https://github.com/flightaware/speedtables/issues/46#issuecomment-68991505 .

resuna commented 8 years ago

This might be worked on alongside the fix to issue #38 if boost allows for it.