3 ms·
puts incredibly nitpicky code reviewer hat on Does the JVM allow using __attribute__ annotations? There's one for alignment, __attribute__((aligned(L1_DCACHE_L
by xxpor 4y ago
puts incredibly nitpicky code reviewer hat on
Does the JVM allow using __attribute__ annotations? There's one for alignment, __attribute__((aligned(L1_DCACHE_LINE_SIZE))) (where L1_DCACHE_LINE_SIZE is defined by gcc -DL1_DCACHE_LINE_SIZE=`getconf LEVEL1_DCACHE_LINESIZE`) that could be used instead of the array, see: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Variable-Attributes.html#Common-Variable-Attributes https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Variabl...
- bitcharmer 4y agoI think the array might be better because it works on all architectures and all platforms.
- deleted 4y ago[deleted]
- wahern 4y agoC11 added `_Alignas`, and it looks like C++11 has `alignas`, so you don't need to rely on vendor-specific extensions for alignment, unless the JVM restricts itself to an earlier standard. LEVEL1_DCACHE_LINESIZE looks to be specific to Linux and Solaris, however.