From ad3ce6afab30fb68cfcda40a1910b87279795c5a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 21 Apr 2021 08:01:30 +0200 Subject: pkg/compiler: optimize array[const] representation Represent array[const[X, int8], N] as string["XX...X"]. This replaces potentially huge number of: NONFAILING(*(uint8_t*)0x2000126c = 0); NONFAILING(*(uint8_t*)0x2000126d = 0); NONFAILING(*(uint8_t*)0x2000126e = 0); with a single memcpy. In one reproducer we had 3991 such lines. Also replace memcpy's with memset's when possible. Update #1070 --- sys/linux/test/file_immutable | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/linux/test/file_immutable') diff --git a/sys/linux/test/file_immutable b/sys/linux/test/file_immutable index f9df5ddc9..46c81692e 100644 --- a/sys/linux/test/file_immutable +++ b/sys/linux/test/file_immutable @@ -4,7 +4,7 @@ # requires: -sandbox=namespace -sandbox=setuid r0 = openat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x26e1, 0x0) -ioctl$FS_IOC_FSSETXATTR(r0, 0x40086602, &AUTO={0x17e, 0x0, 0x0, 0x0, 0x0, [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]}) +ioctl$FS_IOC_FSSETXATTR(r0, 0x40086602, &AUTO={0x17e, 0x0, 0x0, 0x0, 0x0, "0000000000000000"}) mkdirat(0xffffffffffffff9c, &AUTO='./file1\x00', 0x1ff) r1 = openat(0xffffffffffffff9c, &AUTO='./file1\x00', 0x0, 0x0) -ioctl$FS_IOC_FSSETXATTR(r1, 0x40086602, &AUTO={0x17e, 0x0, 0x0, 0x0, 0x0, [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]}) +ioctl$FS_IOC_FSSETXATTR(r1, 0x40086602, &AUTO={0x17e, 0x0, 0x0, 0x0, 0x0, "0000000000000000"}) -- cgit mrf-deployment