Use free() to deallocate memory for _buffer if HAVE_POSIX_MEMALIGN is defined. * src/SingleFileAllocationIterator.cc (~SingleFileAllocationIterator)
@@ -1,3 +1,9 @@
+2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
+
+ Use free() to deallocate memory for _buffer if HAVE_POSIX_MEMALIGN is
+ defined.
+ * src/SingleFileAllocationIterator.cc (~SingleFileAllocationIterator)
2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use erase+lower_bound+insert instead of sort.
@@ -37,6 +37,7 @@
#include "Util.h"
#include "a2io.h"
#include <cstring>
+#include <cstdlib>
namespace aria2 {
@@ -52,7 +53,11 @@ SingleFileAllocationIterator::SingleFileAllocationIterator(BinaryStream* stream,
SingleFileAllocationIterator::~SingleFileAllocationIterator()
{
+#ifdef HAVE_POSIX_MEMALIGN
+ free(_buffer);
+#else
delete [] _buffer;
+#endif // HAVE_POSIX_MEMALIGN
}
void SingleFileAllocationIterator::init()