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)
This commit is contained in:
Tatsuhiro Tsujikawa 2008-05-14 15:51:35 +00:00
parent 46636201c1
commit 148b1baf38
2 changed files with 11 additions and 0 deletions

View File

@ -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.

View File

@ -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()