私のコードは機能しているようです(上記のエラーのため、大きなデータセットでは試していません)。
コード:
#include <iostream>
#include <queue>
#include <stxxl/queue>
int main()
{
//queue<int> q; //this works
stxxl::queue<int> q; //does not work
for (int i = 0; i<100; i++) {
q.push(i);
}
std::cout << "done copying" << std::endl;
while (q.empty() == false) {
std::cout << q.front() << std::endl;
q.pop();
}
std::cout << "done poping" << std::endl;
return 0;
}
私のシンプル.stxxl
は単純です:disk=./testfile,0,syscall
しかし、私のエラーは次のとおりです。
stackexchangeexample(3884) malloc: *** error for object 0x101c04000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
The program has unexpectedly finished.
トラブルシューティングの方法がわかりません。この場合、メモリを解放する必要がありますか? 私はまだ C++ を学んでいるので、これが本当に基本的なものである場合は申し訳ありません (これは stxxl キューを使用する場合にのみ発生します)。