Skip to content

Commit

Permalink
Apple silicon has 128 byte alignment so fix our defines to match (Jul…
Browse files Browse the repository at this point in the history
…iaLang#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

(cherry picked from commit 91ec2bb)
  • Loading branch information
gbaraldi authored and Drvi committed Jun 7, 2024
1 parent 7b1b2c2 commit a7e2162
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,11 @@ STATIC_INLINE uint8_t JL_CONST_FUNC jl_gc_szclass_align8(unsigned sz) JL_NOTSAFE
}

#define JL_SMALL_BYTE_ALIGNMENT 16
#if defined(_CPU_AARCH64_) && defined(_OS_DARWIN_) // Apple silicon has 128 cache lines
#define JL_CACHE_BYTE_ALIGNMENT 128
#else
#define JL_CACHE_BYTE_ALIGNMENT 64
#endif
// JL_HEAP_ALIGNMENT is the maximum alignment that the GC can provide
#define JL_HEAP_ALIGNMENT JL_SMALL_BYTE_ALIGNMENT
#define GC_MAX_SZCLASS (2032-sizeof(void*))
Expand Down

0 comments on commit a7e2162

Please sign in to comment.