Changeset 800 for trunk/libtorrent/src/torrent/chunk_manager.h
- Timestamp:
- 11/04/06 11:05:28 (6 years ago)
- Files:
-
- 1 modified
-
trunk/libtorrent/src/torrent/chunk_manager.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtorrent/src/torrent/chunk_manager.h
r798 r800 61 61 // usage to a resonable value. This should be based on the arch, 62 62 // ulimit and errors encountered when mmap'ing. 63 bool auto_memory() const { return m_autoMemory; }64 void set_auto_memory(bool state) { m_autoMemory = state; }63 bool auto_memory() const { return m_autoMemory; } 64 void set_auto_memory(bool state) { m_autoMemory = state; } 65 65 66 uint64_t memory_usage() const { return m_memoryUsage; }66 uint64_t memory_usage() const { return m_memoryUsage; } 67 67 68 68 // Should we allow the client to reserve some memory? 69 69 70 70 // The client should set this automatically if ulimit is set. 71 uint64_t max_memory_usage() const { return m_maxMemoryUsage; }72 void set_max_memory_usage(uint64_t bytes) { m_maxMemoryUsage = bytes; }71 uint64_t max_memory_usage() const { return m_maxMemoryUsage; } 72 void set_max_memory_usage(uint64_t bytes) { m_maxMemoryUsage = bytes; } 73 73 74 74 // Estimate the max memory usage possible, capped at 1GB. … … 77 77 uint64_t safe_free_diskspace() const; 78 78 79 bool safe_sync() const { return m_safeSync; }80 void set_safe_sync(uint32_t state) { m_safeSync = state; }79 bool safe_sync() const { return m_safeSync; } 80 void set_safe_sync(uint32_t state) { m_safeSync = state; } 81 81 82 82 // Set the interval to wait after the last write to a chunk before 83 83 // trying to sync it. By not forcing a sync too early it should give 84 84 // the kernel an oppertunity to sync at its convenience. 85 uint32_t timeout_sync() const { return m_timeoutSync; }86 void set_timeout_sync(uint32_t seconds) { m_timeoutSync = seconds; }85 uint32_t timeout_sync() const { return m_timeoutSync; } 86 void set_timeout_sync(uint32_t seconds) { m_timeoutSync = seconds; } 87 87 88 uint32_t timeout_safe_sync() const { return m_timeoutSafeSync; } 89 void set_timeout_safe_sync(uint32_t seconds) { m_timeoutSafeSync = seconds; } 88 uint32_t timeout_safe_sync() const { return m_timeoutSafeSync; } 89 void set_timeout_safe_sync(uint32_t seconds) { m_timeoutSafeSync = seconds; } 90 91 // Set to 0 to disable preloading. 92 // 93 // How the value is used is yet to be determined, but it won't be 94 // able to use actual requests in the request queue as we can easily 95 // stay ahead of it causing preloading to fail. 96 uint32_t preload_min_pipelined() const { return m_preloadMinPipelined; } 97 void set_preload_min_pipelined(uint32_t size) { m_preloadMinPipelined = size; } 98 99 uint32_t preload_min_size() const { return m_preloadMinSize; } 100 void set_preload_min_size(uint32_t bytes) { m_preloadMinSize = bytes; } 101 102 // Required rate before attempting to preload chunk, per whole 103 // megabyte of chunk size. 104 uint32_t preload_required_rate() const { return m_preloadRequiredRate; } 105 void set_preload_required_rate(uint32_t bytes) { m_preloadRequiredRate = bytes; } 90 106 91 107 void insert(ChunkList* chunkList); … … 119 135 uint32_t m_timeoutSafeSync; 120 136 137 uint32_t m_preloadMinPipelined; 138 uint32_t m_preloadMinSize; 139 uint32_t m_preloadRequiredRate; 140 121 141 int32_t m_timerStarved; 122 142 size_type m_lastFreed;
