From b8db6914a2a7da45cf0aed20240c8c6696a16968 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 24 Sep 2023 20:19:21 +0000 Subject: syscall: have `vec' operate on bytes directly Instead of converting to bytes to bits and asking `vec' to operate on single bits, we can just have `vec' work on 8 bits at-a-time. This also fixes an overallocation in pure Perl Linux recv_cmd4. Adding an extra byte ourselves for "\0" isn't necessary: Perl already does it internally everywhere when creating/resizing scalars. --- t/cmd_ipc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/cmd_ipc.t b/t/cmd_ipc.t index 7313d13b..e5d22aab 100644 --- a/t/cmd_ipc.t +++ b/t/cmd_ipc.t @@ -97,7 +97,7 @@ my $do_test = sub { SKIP: { my $nr = 2 * 1024 * 1024; while (1) { - vec(my $vec = '', $nr * 8 - 1, 1) = 1; + vec(my $vec = '', $nr - 1, 8) = 1; my $n = $send->($s1, [], $vec, $flag); if (defined($n)) { $n == length($vec) or -- cgit v1.2.3-24-ge0c7