Is it possible to create a memory pool shared between processes (for example from CreateFileMapping with INVALID_HANDLE_VALUE in Win32) and then use that chunk of memory as a heap ?
I would like the new/delete operators (or malloc/free) to allocate/free memory from that chunk (and do their usual heap management on it).
Thanks.
EDIT: My real problem is simple: for now I use the new operator to allocate various large series of structures normally, but I want these structures to persist after the process closes. So I would like to create another process whose almost only function is to hold the memory when the main process closes.
For that, I would create a chunk of shared memory with CreateFileMapping in the auxiliary process, and, in the main process, tell those new/delete used to allocate the structures to use that chunk instead of the process's heap.
To recover the structures after the main processes is relaunched, I would add a fixed amount to all the pointers, reflecting the different origins of the mapped view returned by MapViewOfFile.