Question: I would like to use shared memory between several processes, and would like to be able to keep using raw pointers (and stl containers). 

For this purpose, I am using shared memory mapped at a *fixed address*:

```
segment = new boost::interprocess::managed_shared_memory(
    boost::interprocess::open_or_create,
    "MySegmentName",
    1048576, // alloc size
    (void *)0x400000000LL // fixed address
);

```

What is a good strategy for choosing this fixed address? For example, should I just use a pretty high number to reduce the chance that I run out of heap space?

Answer: 
Read the address from a configuration file. That will allow easy experimentation, and make it easy to change the address as the circumstances change.
Don't use hard-coded absolute addresses as shared memory area for security reasons, even when you don't uses forks or threads. This bypasses all ASLR protections. It enables any attacker predictable locations in the process' address space. It is pretty easy to search for such hard-coded pointers in a binary.

You've been choosen by <http://reversingonwindows.blogspot.sg/2013/12/hardcoded-pointers.html> as example how to make software less secure, bypassing ASLR. 
The 2nd bad example is in the [boost library](http://www.boost.org/doc/libs/1_47_0/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.mapped_region.mapped_region_fixed_address_mapping).

The address space needs to be negotiated between the communicating parties at run-time.