Host introspection
use NativeCall;
say $*VM.config<ptr_size>;
my $bytes = nativecast(CArray[uint8], CArray[uint16].new(1));
say $bytes[0] ?? "little-endian" !! "big-endian";Output:
8
little-endiansay blob8.new(1,0).read-int16(0) == 1 ?? "little-endian" !! "big-endian"say join ', ', $*KERNEL, $*KERNEL.bits, $*KERNEL.arch, $*KERNEL.endianOutput:
linux, 64, x86_64, LittleEndianLast updated