Skip to content

Commit 8888443

Browse files
committed
add doc comments for BuilderSegment
1 parent 72b5a1c commit 8888443

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

capnp/src/private/arena.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,17 @@ pub trait BuilderArena: ReaderArena {
167167
fn as_reader(&self) -> &dyn ReaderArena;
168168
}
169169

170+
/// A wrapper around a memory segment used in building a message.
170171
struct BuilderSegment {
172+
/// Pointer to the start of the segment.
171173
ptr: *mut u8,
172-
capacity: u32, // in words
173-
allocated: u32, // in words
174+
175+
/// Total number of words the segment could potentially use. That is, all
176+
/// bytes from `ptr` to `ptr + (capacity * 8)` may be used in the segment.
177+
capacity: u32,
178+
179+
/// Number of words already used in the segment.
180+
allocated: u32,
174181
}
175182

176183
pub struct BuilderArenaImplInner<A>

0 commit comments

Comments
 (0)