Skip to content

Commit

Permalink
update docs comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SkymanOne committed Feb 22, 2024
1 parent 815edee commit da598d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .config/cargo_spellcheck.dic
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Wasm32
WebAssembly
adjunctive
bitvector
bitmask
bitwise
callee
codegen
Expand Down
6 changes: 4 additions & 2 deletions crates/allocator/src/bump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ impl InnerAlloc {
/// of a layout in the linear memory.
/// - Initially `self.next` is `0`` and aligned
/// - `layout.align() - 1` accounts for `0` as the first index.
/// - the binary with the inverse of the align ensures
/// that the next allocated pointer address is of the power of 2.
/// - the binary with the inverse of the align creates a
/// bitmask that is used to zero out bits, ensuring alignment according to type
/// requirements and ensures that the next allocated pointer address is of the
/// power of 2.
fn align_ptr(&self, layout: &Layout) -> usize {
(self.next + layout.align() - 1) & !(layout.align() - 1)
}
Expand Down

0 comments on commit da598d3

Please sign in to comment.