i have two programs.
#include <iostream>
#include <boost/interprocess/managed_shared_memory.hpp>
int main(int argc, char const* argv[])
{
boost::interprocess::shared_memory_object::remove("High");
try {
boost::interprocess::managed_shared_memory managed_shm(
boost::interprocess::create_only,
"High",
256);
std::cout << "success" << std::endl;
}
catch (boost::interprocess::interprocess_exception &ex) {
std::cout << ex.what() << std::endl;
}
return 0;
}
It prints the output "boost::interprocess_exception::library_error"
But changing 256 to 512, it prints "success":
#include <iostream>
#include <boost/interprocess/managed_shared_memory.hpp>
int main(int argc, char const* argv[])
{
boost::interprocess::shared_memory_object::remove("High");
try {
boost::interprocess::managed_shared_memory managed_shm(
boost::interprocess::create_only,
"High",
512);
std::cout << "success" << std::endl;
}
catch (boost::interprocess::interprocess_exception &ex) {
std::cout << ex.what() << std::endl;
}
return 0;
}
what is the difference between 256 and 512?