Skip to content

Commit 91ec2bb

Browse files
authored
Apple silicon has 128 byte alignment so fix our defines to match (JuliaLang#52996)
https://github.com/JuliaLang/julia/blob/8a69745bdcb06409ab7e4fc84718f34d7d54a7f9/base/lock.jl#L33-L50 this probably also needs a fix, and maybe other places as well
1 parent 35c0498 commit 91ec2bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/julia_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,11 @@ STATIC_INLINE uint8_t JL_CONST_FUNC jl_gc_szclass_align8(unsigned sz) JL_NOTSAFE
485485
}
486486

487487
#define JL_SMALL_BYTE_ALIGNMENT 16
488+
#if defined(_CPU_AARCH64_) && defined(_OS_DARWIN_) // Apple silicon has 128 cache lines
489+
#define JL_CACHE_BYTE_ALIGNMENT 128
490+
#else
488491
#define JL_CACHE_BYTE_ALIGNMENT 64
492+
#endif
489493
// JL_HEAP_ALIGNMENT is the maximum alignment that the GC can provide
490494
#define JL_HEAP_ALIGNMENT JL_SMALL_BYTE_ALIGNMENT
491495
#define GC_MAX_SZCLASS (2032-sizeof(void*))

0 commit comments

Comments
 (0)