storage optimization. introduced a nother allocation mode: sparse. Now there is allocate, compact and sparse. Unless compact is used, the memory structures used to keep track of pieces are no longer allocated. sparse storage mode is now the default

This commit is contained in:
Arvid Norberg
2007-10-08 20:01:36 +00:00
parent e7a40f4a08
commit 4d19f7ff0f
12 changed files with 479 additions and 400 deletions

View File

@@ -154,7 +154,7 @@ namespace libtorrent
, boost::intrusive_ptr<torrent_info> tf
, fs::path const& save_path
, tcp::endpoint const& net_interface
, bool compact_mode
, storage_mode_t storage_mode
, int block_size
, storage_constructor_type sc
, bool paused)
@@ -195,7 +195,7 @@ namespace libtorrent
, m_total_redundant_bytes(0)
, m_net_interface(net_interface.address(), 0)
, m_save_path(complete(save_path))
, m_compact_mode(compact_mode)
, m_storage_mode(storage_mode)
, m_default_block_size(block_size)
, m_connections_initialized(true)
, m_settings(ses.settings())
@@ -215,7 +215,7 @@ namespace libtorrent
, char const* name
, fs::path const& save_path
, tcp::endpoint const& net_interface
, bool compact_mode
, storage_mode_t storage_mode
, int block_size
, storage_constructor_type sc
, bool paused)
@@ -255,7 +255,7 @@ namespace libtorrent
, m_total_redundant_bytes(0)
, m_net_interface(net_interface.address(), 0)
, m_save_path(complete(save_path))
, m_compact_mode(compact_mode)
, m_storage_mode(storage_mode)
, m_default_block_size(block_size)
, m_connections_initialized(false)
, m_settings(ses.settings())
@@ -2218,7 +2218,7 @@ namespace libtorrent
TORRENT_ASSERT(m_storage);
TORRENT_ASSERT(m_owning_storage.get());
done = m_storage->check_fastresume(data, m_have_pieces, m_num_pieces
, m_compact_mode);
, m_storage_mode);
}
catch (std::exception& e)
{
@@ -2768,7 +2768,7 @@ namespace libtorrent
!boost::bind(&peer_connection::is_connecting
, boost::bind(&std::map<tcp::endpoint,peer_connection*>::value_type::second, _1)));
st.compact_mode = m_compact_mode;
st.storage_mode = m_storage_mode;
st.num_complete = m_complete;
st.num_incomplete = m_incomplete;