Skip to content

Commit

Permalink
Merge pull request #27 from aliciawyy/wipDoc
Browse files Browse the repository at this point in the history
Improve clarity of alloc_aligned doc
  • Loading branch information
jiegec authored Jul 18, 2023
2 parents 60f356e + ac6023f commit a5136d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ impl<const ORDER: usize> FrameAllocator<ORDER> {

/// Allocate a range of frames with the given size and alignment from the allocator, returning
/// the first frame of the allocated range.
/// The allocated size is the maximum of the next power of two of the given size and the
/// alignment.
pub fn alloc_aligned(&mut self, layout: Layout) -> Option<usize> {
let size = max(layout.size().next_power_of_two(), layout.align());
self.alloc_power_of_two(size)
Expand Down

0 comments on commit a5136d6

Please sign in to comment.