Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub(crate) struct BoxedString {
///
/// Returns `true` if aligned to an odd address, `false` if even. The sense of
/// the boolean is "does this look like an InlineString? true/false"
#[inline]
fn check_alignment(ptr: *const u8) -> bool {
ptr.align_offset(2) > 0
}
Expand All @@ -53,6 +54,7 @@ impl GenericString for BoxedString {
impl BoxedString {
const MINIMAL_CAPACITY: usize = MAX_INLINE * 2;

#[inline]
pub(crate) fn check_alignment(this: &Self) -> bool {
check_alignment(this.ptr.as_ptr())
}
Expand Down