Skip to content

Commit

Permalink
add some comments on allocate_segment() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 20, 2022
1 parent 8c9d41b commit 551dcdf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions capnp/src/private/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ impl <A> BuilderArenaImpl<A> where A: Allocator {
}
}

/// Allocates a new segment with capacity for at least `minimum_size` words.
pub fn allocate_segment(&self, minimum_size: u32) -> Result<()> {
self.inner.borrow_mut().allocate_segment(minimum_size)
}
Expand Down Expand Up @@ -233,6 +234,7 @@ impl <A> ReaderArena for BuilderArenaImpl<A> where A: Allocator {
}

impl <A> BuilderArenaImplInner<A> where A: Allocator {
/// Allocates a new segment with capacity for at least `minimum_size` words.
fn allocate_segment(&mut self, minimum_size: WordCount32) -> Result<()> {
let seg = match self.allocator {
Some(ref mut a) => a.allocate_segment(minimum_size),
Expand Down

0 comments on commit 551dcdf

Please sign in to comment.