Following tsan warning appears on arm64 when using dist barrier:
1: ==603732==ERROR: ThreadSanitizer: invalid alignment requested in aligned_alloc: 1024,\ alignment must be a power of two and the requested size 0x900 must be a multiple of alignment
As the message says, roundup the size to be passed in alinged_alloc to fix this.