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.

Home Page:https://flightaware.github.io/speedtables/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapped file base address is not honored

bovine opened this issue · comments

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.

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

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,
default_size, (void_)addr); } else { mmf = new managed_mapped_file(open_only,
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
#46 (comment)
.

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