
Shibu Bera wrote:
Hi,
After creating the shared memory I put three containers (boost::multi_index, std::map and std::vector) into the shared memory, then objects into the containers. But in later part of the execution, there are condition when I need to remove these elements and containers. I also don't want to eat up the primary memory by creating the saparate shared memory nor I want to remove the earlier shared memory. If I just destroy the containers the previous garbage data may create problem. So I want such method or way to memset the shared memory with NULL characters. This information should suffice the query, Can I get some clue now?
Which type of problems, security problems? Or do you base your program on the value the memory you allocate has before using it? If your destroy the containers and after that you create new ones, I think you shouldn't have problems. If for any reason, (security or whatever) you need to guarantee that all free memory (memory that does not contain any object in the segment) is zeroed before being reused, I would need to add new functionality to the library, because this is not currently possible: the memory allocation algorithm should have a function that traverses all the free memory segments and memsets them. These days I will be busy with the Intrusive review, so you would need to wait until the end of the month to get this functionality. Regards, Ion