I am just guessing, as I have never used singleton_pool
Ok, now it work well, thanks!
But..I have another problem. In this code (C++11 with std::tuple)
#include <iostream>
#include <map>
#include <tuple>
#include <boost/pool/pool_alloc.hpp>std::map<std::string,std::tuple<uint16_t,uint16_t>> myComplexType;
using namespace std;
struct data
{
int a,b;
char name[50];
};data *d = (data*)myStruct::poolMemory::malloc();
struct myStruct
{
struct MyOrderTag {};
typedef boost::singleton_pool<MyOrderTag,sizeof(data)> poolMemory;
};
int main()
{
d->a = 8;
strcpy(d->name,"Hello!");
//fill myComplexType field (this row causes a segfault!)
d->myComplexType["one"] = std::tuple<uint16_t,uint16_t>(1,2);
myStruct::poolMemory::release_memory();
return 0;
}
I obtain a segmentation fault error when assign a tuple at myComplexType
field. What is wrong?
--
View this message in context: http://boost.2283326.n4.nabble.com/Pool-Use-singleton-pool-in-struct-tp4636741p4637005.html
Sent from the Boost - Users mailing list archive at Nabble.com.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users