'Store process specific data by key

I have my own programming language that embeds BoehmGC. Problem is that trouble will start when having multiple instances of boehm loaded in the same process, which is something I want to avoid. When loading a main process and 1 or more shared objects I need a way to avoid having Boehmgc be loaded twice without any hard dependencies on external or internal libraries. On Windows I solve this with a (memory) mapped file and store the data in there. I'm looking for something on posix (linux, android, freebsd and possibly osx) where I can do the same. The key here is that the process and the shared objects don't share any data/pointers, so I would need something that works by (string) key.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source