authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-04 23:22:40+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-05 07:17:40+02:00
logadc4418bae54e51921cde937d96faebf576f6d0c
tree0e18fe0fcd17b16ad5143ee6bddaa6860dffbdfd
parent9d534790ebc869ec933e932abe4be8b9e3593bbc

std.fs.Dir.Iterator: Address a couple of alignment TODOs.


1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/fs/Dir.zig+2-4
...@@ -24,7 +24,7 @@ pub const Iterator = switch (native_os) {...@@ -24,7 +24,7 @@ pub const Iterator = switch (native_os) {
24 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct {24 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct {
25 dir: Dir,25 dir: Dir,
26 seek: i64,26 seek: i64,
27 buf: [1024]u8, // TODO align(@alignOf(posix.system.dirent)),27 buf: [1024]u8 align(@alignOf(posix.system.dirent)),
28 index: usize,28 index: usize,
29 end_index: usize,29 end_index: usize,
30 first_iter: bool,30 first_iter: bool,
...@@ -328,8 +328,6 @@ pub const Iterator = switch (native_os) {...@@ -328,8 +328,6 @@ pub const Iterator = switch (native_os) {
328 },328 },
329 .linux => struct {329 .linux => struct {
330 dir: Dir,330 dir: Dir,
331 // The if guard is solely there to prevent compile errors from missing `linux.dirent64`
332 // definition when compiling for other OSes. It doesn't do anything when compiling for Linux.
333 buf: [1024]u8 align(@alignOf(linux.dirent64)),331 buf: [1024]u8 align(@alignOf(linux.dirent64)),
334 index: usize,332 index: usize,
335 end_index: usize,333 end_index: usize,
...@@ -490,7 +488,7 @@ pub const Iterator = switch (native_os) {...@@ -490,7 +488,7 @@ pub const Iterator = switch (native_os) {
490 },488 },
491 .wasi => struct {489 .wasi => struct {
492 dir: Dir,490 dir: Dir,
493 buf: [1024]u8, // TODO align(@alignOf(posix.wasi.dirent_t)),491 buf: [1024]u8 align(@alignOf(std.os.wasi.dirent_t)),
494 cookie: u64,492 cookie: u64,
495 index: usize,493 index: usize,
496 end_index: usize,494 end_index: usize,