moved page_aligned_allocator to its own file and uses it in set_piece_hashes to not pass in unaligned buffers to storage read

This commit is contained in:
Arvid Norberg
2009-01-15 17:09:36 +00:00
parent 9edfd93603
commit 113d1f3557
9 changed files with 134 additions and 37 deletions

View File

@@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#endif
#include "libtorrent/storage.hpp"
#include "libtorrent/allocator.hpp"
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
@@ -53,15 +54,6 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
struct page_aligned_allocator
{
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
static char* malloc(const size_type bytes);
static void free(char* const block);
};
struct cached_piece_info
{
int piece;