Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces disk cache per-block memory overhead by replacing stored disk_buffer_holder ownership in cache entries with a pointer-only reference, and plumbing piece sizing to support correct block-span sizing during hashing.
Changes:
- Introduces
disk_buffer_refand updates cache block entries to store pointer-only buffer ownership. - Updates
disk_cacheto compute correct per-block span sizes (including shorter last blocks) via a newpiece_sizeparameter. - Adjusts disk I/O and unit tests to provide the new piece sizing metadata to the cache.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
include/libtorrent/disk_buffer_holder.hpp |
Adds disk_buffer_ref; changes bulk_free_buffer ctor/add API. |
src/disk_buffer_holder.cpp |
Implements disk_buffer_ref moves and new bulk_free_buffer::add. |
include/libtorrent/aux_/disk_cache.hpp |
Switches cached_block_entry to disk_buffer_ref; updates buffer access API and piece params; adds cache allocator member. |
src/disk_cache.cpp |
Implements new buffer accessors and updates hashing/flush/free paths to use pointer-only buffer refs and batched frees. |
src/pread_disk_io.cpp |
Supplies new piece_size field when inserting cache blocks. |
test/test_disk_cache.cpp |
Updates test fixture piece params to include piece_size. |
include/libtorrent/fwd.hpp |
Forward-declares disk_buffer_ref. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7667b20 to
fb1a3f8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c641e1b to
9f5fb81
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f5fb81 to
256b3a6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
256b3a6 to
6774d45
Compare
…hed_block_entry in the cache, decreasing the overhead of the cache
6774d45 to
6facd76
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
only keep a pointer rather than a whole
disk_buffer_holderin thecached_block_entryin the cache, decreasing the overhead of the cache.