stxxl 맵에 요소를 삽입 할 때이 어설 션에 실패했습니다.stxxl 어설 션`it! = root_node_.end() '가 실패했습니다
resCache : /usr/include/stxxl/bits/containers/btree/btree.h:470 : 표준 : : 쌍>, 부울> stxxl ::
전체 어설 션 오류는 다음이다 btree :: btree :: insert (const value_type &) [KeyType = e_my_key, DataType = 부호없는 int, CompareType = comp_type, 부호없는 int RawNodeSize = 16384u, 부호없는 int RawLeafSize = 131072u, PDAllocStrategy = stxxl :: SR, stxxl :: btree :: btree :: value_type = std :: pair] : 어설 션`it! = root_node_.end() '가 실패했습니다. 중단됨
어떤 아이디어가 있습니까?
편집 : 사용 Valgrind의 : 여기
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