Fixing the Size of a Map in Shared Memory

  • Context: C/C++ 
  • Thread starter Thread starter FrostScYthe
  • Start date Start date
  • Tags Tags
    Map Memory
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
FrostScYthe
Messages
80
Reaction score
0
Hi, I'm wondering how to give a map a fixed size like you can give an array a fixed size by just "byte data[SIZE*DATASIZE]".. or if it's possible anybody know..

struct Table {
map<int, int> table; //
};

struct Table *flightChart;

The reason I have to give this a fixed size, is because I have to map this in shared memory :\, so that another process may access it, or is it possible to pass this structure to another process without shared memory :\
 
Physics news on Phys.org
Even if it were fixed size, sharing your map object in shared memory might not accomplish what you want to do anyway. There's no guarantee that the map object store its data within a single contiguous block of memory -- it may store data in blocks all over the heap.

- Warren