M
Michael Mol
What would be involved if one wanted to confine all of the data
associated with std::map to a specific region in memory? The specific
example I had in mind when I pondered this earlier today was as a way
of organizing shared-memory IPC. For the production project, I'm
going with a simpler approach, but it still seemed like an interesting
problem.
I have a vague understanding that this would require a custom
allocator, that the allocator's bookkeeping information would need to
reside within the shared memory region as well, that the types serving
as keys and data could not allocate their own memory (or would need to
use the same custom allocator) and that those types could not have
virtual functions (A function pointer becomes meaningless once you
find yourself in a different address space.).
There's also the obvious requirement of adequate synchronization and
class member padding.
Am I missing anything?
associated with std::map to a specific region in memory? The specific
example I had in mind when I pondered this earlier today was as a way
of organizing shared-memory IPC. For the production project, I'm
going with a simpler approach, but it still seemed like an interesting
problem.
I have a vague understanding that this would require a custom
allocator, that the allocator's bookkeeping information would need to
reside within the shared memory region as well, that the types serving
as keys and data could not allocate their own memory (or would need to
use the same custom allocator) and that those types could not have
virtual functions (A function pointer becomes meaningless once you
find yourself in a different address space.).
There's also the obvious requirement of adequate synchronization and
class member padding.
Am I missing anything?