Skip to content

Commit

Permalink
gemm: request no mask buffer alignment on macos
Browse files Browse the repository at this point in the history
A user showed that in certain configurations, the TLS allocation can even be
8-byte aligned, so just remove the repr(align()) on macos.
  • Loading branch information
bluss committed Sep 20, 2023
1 parent d6aef69 commit 3d9dcd2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gemm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,10 @@ const MASK_BUF_SIZE: usize = KERNEL_MAX_SIZE + KERNEL_MAX_ALIGN - 1;

// Pointers into buffer will be manually aligned anyway, due to
// bugs we have seen on certain platforms (macos) that look like
// we don't get more than 16-aligned allocations out of TLS
// we don't get aligned allocations out of TLS - 16- and 8-byte
// allocations have been seen, but make no align request so that
// it can't fail.
#[cfg_attr(not(target_os = "macos"), repr(align(32)))]
#[cfg_attr(target_os = "macos", repr(align(16)))]
struct MaskBuffer {
buffer: [u8; MASK_BUF_SIZE],
}
Expand Down

0 comments on commit 3d9dcd2

Please sign in to comment.