Wouter van Kleunen
Wouter van Kleunen
Boost Interprocess Offset pointer: https://www.boost.org/doc/libs/1_75_0/doc/html/interprocess/offset_ptr.html Please observe the following: One of the big problems of offset_ptr is the representation of the null pointer. The null pointer can't be safely represented...
Yes, i can make small example
This is the easy case: https://wandbox.org/permlink/uFzkywyr2StzUq4i But we actually need scoped allocation with piecewise construction as well, i can add example of this later.
This is with a scoped allocation example: https://wandbox.org/permlink/08K4Pd3wVUcscwJG Vector in map using a scoped allocator
I cleaned up the example a little bit more: https://wandbox.org/permlink/21FjLvAenx9j76P9
Hello @greg7mdp, do you think this is possible ? Or are there any show-stopping issues ?
What was the error you got ?
I actually worked around the issue now, by implementing a custom allocator, which keeps the mmap region open, even after resizing. This way, the pointers don't need to be offset...
You don't actually have to manage the array yourself, you can use std::vector to allocate the array of pairs for you. You can make the actual storage container a template...
Yes, the github repository already has some performance enhancements and bugfixes. So it is best to checkout the example from the github repository.