当我尝试将一对添加到向量时,我收到此错误:
table: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted
这是方法:
std::vector<std::pair <int, int> > AI::genPosNormal(int p, int dice)
{
std::vector<std::pair <int, int> > pos;
std::pair<int, int> step;
for(int i = p; i < 25-dice; i++){
if(board[BLACK][i] > 0 && board[WHITE][i+dice] < 2){
step.first = i;
step.second = dice;
pos.push_back(step);
}
}
return pos;
}