Я получаю это утверждение с ошибкой при попытке вставить элемент в stxxl-карту.stxxl Assertion `it! = Root_node_.end() 'failed
Вся ошибка утверждение следующее:
resCache: /usr/include/stxxl/bits/containers/btree/btree.h:470: станд :: пара>, BOOL> stxxl :: btree :: btree :: insert (const value_type &) [с KeyType = e_my_key, DataType = unsigned int, CompareType = comp_type, unsigned int RawNodeSize = 16384u, unsigned int RawLeafSize = 131072u, PDAllocStrategy = stxxl :: SR, stxxl :: btree :: btree :: value_type = std :: pair]: Утверждение `it! = root_node_.end() 'не выполнено. Aborted
Идея?
Edit: Вот фрагмент кода
void request_handler::handle_request(my_key& query, reply& rep)
{
c_++;
std::cout << "Received query " << query.content << " by thread " << boost::this_thread::get_id() << ". It is number " << c_ << "\n";
strcpy(element.first.content, query.content);
element.second = c_;
testcache_.insert(element);
STXXL_MSG("Records in map: " << testcache_.size());
}
Edit2 вот больше деталей (я опускаю константы, например MAX_QUERY_LEN)
struct comp_type : std::binary_function<my_key, my_key, bool>
{
bool operator() (const my_key & a, const my_key & b) const
{
return strncmp(a.content, b.content, MAX_QUERY_LEN) < 0;
}
static my_key max_value()
{
return max_key;
}
static my_key min_value()
{
return min_key;
}
};
typedef stxxl::map<my_key, my_data, comp_type> cacheType;
cacheType testcache_;
request_handler::request_handler()
:testcache_(NODE_CACHE_SIZE, LEAF_CACHE_SIZE)
{
c_ = 0;
memset(max_key.content, (std::numeric_limits<unsigned char>::max)(), MAX_QUERY_LEN);
memset(min_key.content, (std::numeric_limits<unsigned char>::min)(), MAX_QUERY_LEN);
testcache_.enable_prefetching();
STXXL_MSG("Records in map: " << testcache_.size());
}
Какая строка кода в вашем коде запускает утверждение? Как вы пытаетесь вставить элемент? – sth
Можете ли вы опубликовать код? – hmjd
Можете ли вы отправить объявление 'testcache_' и любого компаратора? – hmjd