Repository navigation
docs: state that buffers do not own the bytes they refer to - #493
Conversation
The glossary defined a buffer as a region of memory, which invites reading a buffer as the storage itself. Say throughout the buffer and stream pages, the glossary, and the buffer type reference that a buffer is a non-owning handle whose bytes must stay valid until every operation using it completes.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
An automated preview of the documentation is available at https://493.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-11-23 14:51:33 UTC |
|
GCOVR code coverage report https://493.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-11-23 15:05:47 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #493 +/- ##
========================================
Coverage 98.49% 98.49%
========================================
Files 135 135
Lines 7364 7364
========================================
Hits 7253 7253
Misses 111 111
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Resolves discussion #433.
The review asked whether
const_buffer,mutable_bufferandmake_buffershould be renamed, because "buffer" reads as the memory itself rather than a view of it. The names stay, matching Asio, and the documentation now says plainly what they are: a buffer is a non-owning handle, a pointer and a size, and the bytes it refers to must stay valid until every operation using it completes.The glossary defined a buffer as "a contiguous region of memory", the reading the review objected to. It now calls it a non-owning handle and links to Lifetime Management. The buffer section's introduction compares a buffer to
std::string_view. Lifetime Management adds that a buffer never owns, allocates or copies its bytes, and that the storage must outlive the operation, not only the call that started it. Themake_buffersection says it neither allocates nor copies, and that a buffer made from a temporary dangles once the full-expression that created the temporary ends. The composite buffer page says a range of buffers owns the pointers and sizes, not the bytes. Theread_someandwrite_somedescriptions say the storage must stay valid until the coroutine resumes. Theconst_bufferandmutable_bufferreference docs carry the same rule.The docs lint gate reports no new findings.
Summary by CodeRabbit